Skip to content
This repository has been archived by the owner on Jul 21, 2019. It is now read-only.

Commit

Permalink
Merge pull request #605 from devopsdays/feature/program-icons
Browse files Browse the repository at this point in the history
Add display of videos and slides to program page
  • Loading branch information
bridgetkromhout committed Sep 3, 2018
2 parents 35d8644 + 9864f73 commit 123a109
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 9 deletions.
11 changes: 10 additions & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
[Pages and Frontmatter](#pages-and-frontmatter)
 [General Page Fields](#general-page-fields)
 [Talk Page Fields](#talk-page-fields)
 [Speaker Page Fields](#speaker-page-fields)
 [Speaker Page Fields](#speaker-page-fields)
 [Program Page Fields](#program-page-fields)
 [Blog Post Fields](#blog-post-fields)
[Shortcodes](#shortcodes)
 [google_form](#google_form)
Expand Down Expand Up @@ -275,6 +276,14 @@ Pages of the type `speaker` have a few additional frontmatter elements available
| `gitlab` | No | Speakers' GitLab username. | "mattstratton" |
| `image` | No | The image for the speaker. This image is relative to the `static/events/YYYY-CITY/speakers` directory. It can be either .png or .jpg. It must be square, and 300px square, 600px square, or 900px square. | "matt-stratton.jpg" |

### Program Page Fields

The page of type `program` has one additional frontmatter element.

| Field Name | Required | Description | Example |
|------------|----------|----------------------------------------------------------|---------|
| `icons` | No | Toggles display of slide/video icons on the program page | "true" |

### Blog Post Fields

| Field Name | Required | Description | Example |
Expand Down
1 change: 1 addition & 0 deletions archetypes/program.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ City = ""
Year = ""
Title = ""
Type = "program"
Icons = "false"
+++
1 change: 1 addition & 0 deletions exampleSite/content/events/2017-ponyville/program.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Year = "2017"
date = "2016-07-15T22:06:24-06:00"
title = "Ponyville 2017 Program"
type = "program"
Icons = "TRUE"
+++

Our program is amazing!
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ talk_end_time = ""
title = "AWS Isn't Scary"
type = "talk"
speakers = ["fluttershy", "spike"]
youtube = ""
vimeo = ""
youtube = "emGKB8TABvI"
vimeo = "abcdefecf1214"
speakerdeck = ""
slideshare = ""
slides = ""
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/events/2017-ponyville/program/spike.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ talk_end_time = ""
title = "Adopting Pony Progress"
type = "talk"
speakers = ["spike"]
youtube = ""
youtube = "emGKB8TABvI"
vimeo = ""
speakerdeck = ""
slideshare = ""
Expand Down
4 changes: 2 additions & 2 deletions exampleSite/data/events/2017-ponyville.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: 2017-ponyville
year: "2017"
city: "Ponyville"
friendly: "2017-ponyville"
startdate: 2017-07-16
enddate: 2017-07-17
startdate: 2017-11-16
enddate: 2017-11-17
cfp_date_start: 2017-03-01
cfp_date_end: 2017-06-15
cfp_date_announce: 2017-01-01
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
41 changes: 39 additions & 2 deletions layouts/program/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ <h2>Program</h2>
{{ .Content }}

{{- $.Scratch.Set "first" "true" -}}
{{- with .Params.icons -}}
{{- $.Scratch.Set "icons" (. | upper ) -}}
{{- end -}}

{{- $e := (index $.Site.Data.events (index (split (.Permalink | relURL) "/") 2)) -}}

Expand All @@ -13,6 +16,28 @@ <h2>Program</h2>
{{- if eq (index (split (.Permalink | relURL) "/") 2) $e.name -}}
{{- $.Scratch.Set "base_file_name" .File.BaseFileName -}}
{{- $.Scratch.Set .File.BaseFileName .Title -}}
{{- with .Params.vimeo -}}
{{- $.Scratch.Set (printf "%s-video_link" ($.Scratch.Get "base_file_name")) (printf "https://player.vimeo.com/video/%s" .) }}
{{- end -}}
{{- with .Params.youtube -}}
{{- $.Scratch.Set (printf "%s-video_link" ($.Scratch.Get "base_file_name")) (printf "https://www.youtube.com/embed/%s" .) }}
{{- end -}}
{{- with .Params.speakerdeck -}}
{{- $.Scratch.Set (printf "%s-slides_link" ($.Scratch.Get "base_file_name")) . }}
{{- end -}}
{{- with .Params.slideshare -}}
{{- $.Scratch.Set (printf "%s-slides_link" ($.Scratch.Get "base_file_name")) . }}
{{- end -}}
{{- with .Params.googleslides -}}
{{- $.Scratch.Set (printf "%s-slides_link" ($.Scratch.Get "base_file_name")) (printf "https://docs.google.com/presentation/d/%s" .) }}
{{- end -}}
{{- with .Params.pdf -}}
{{- $.Scratch.Set (printf "%s-slides_link" ($.Scratch.Get "base_file_name")) . }}
{{- end -}}
{{- with .Params.slides -}}
{{- $.Scratch.Set (printf "%s-slides_link" ($.Scratch.Get "base_file_name")) . }}
{{- end -}}

{{- if isset .Params "speakers" -}}
{{- if ne .Params.speakers "" -}}
{{- $.Scratch.Set "speaker_len" (.Params.speakers | len) -}}
Expand Down Expand Up @@ -89,10 +114,18 @@ <h5 class="mb-0">
{{ $.Scratch.Get (printf "%s-speaker" .title) }}
-
{{ $.Scratch.Get .title }}
</a><br/>

</a>
{{- if eq ($.Scratch.Get "icons") "TRUE" -}}
{{- with ($.Scratch.Get (printf "%s-video_link" .title)) -}}<a href="{{ . }}"><i class="fa fa-video-camera" aria-hidden="true"></i></a>&nbsp;{{- end -}}
{{- with ($.Scratch.Get (printf "%s-slides_link" .title)) -}}<a href="{{ . }}"><i class="fa fa-file-text-o" aria-hidden="true"></i></a>&nbsp;{{- end -}}
{{- end -}}
<br/>
<br/>
{{- if .comments -}}
<span class="program-page-desc">{{ .comments | markdownify }}<br/></span>
{{- end -}}

{{- else if eq .type "ignite" -}}
{{ .title }}
<!-- do ignite stuff here -->
Expand All @@ -107,7 +140,11 @@ <h5 class="mb-0">
<li>
<a href="/events/{{ $e.name}}/program/{{ .title }}">{{ $.Scratch.Get (printf "%s-speaker" .title) }}
-
{{ $.Scratch.Get .title }}</a>
{{ $.Scratch.Get .title }}</a>&nbsp;
{{- if eq ($.Scratch.Get "icons") "TRUE" -}}
{{- with ($.Scratch.Get (printf "%s-video_link" .title)) -}}<a href="{{ . }}"><i class="fa fa-video-camera" aria-hidden="true"></i></a>&nbsp;{{- end -}}
{{- with ($.Scratch.Get (printf "%s-slides_link" .title)) -}}<a href="{{ . }}"><i class="fa fa-file-text-o" aria-hidden="true"></i></a>&nbsp;{{- end -}}
{{- end -}}
</li>
{{- else -}}
<li>
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"devDependencies": {
"del": "^3.0.0",
"gulp": "^4.0.0",
"gulp-bower": "0.0.14",
"gulp-cache": "^1.0.0",
"gulp-concat": "^2.6.1",
"gulp-htmlmin": "^4.0.0",
Expand Down

0 comments on commit 123a109

Please sign in to comment.