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

Commit d4bbcc5

Browse files
committed
Add display of videos and slides to program page
This is still a POC - the icons used can be replaced with something different. Please consider options at http://fontawesome.io/icons/ for other choices. Signed-off-by: Matt Stratton <matt.stratton@gmail.com>
1 parent b236262 commit d4bbcc5

4 files changed

Lines changed: 34 additions & 7 deletions

File tree

exampleSite/content/events/2017-ponyville/program/fluttershy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ talk_end_time = ""
88
title = "AWS Isn't Scary"
99
type = "talk"
1010
speakers = ["fluttershy", "spike"]
11-
youtube = ""
12-
vimeo = ""
11+
youtube = "emGKB8TABvI"
12+
vimeo = "abcdefecf1214"
1313
speakerdeck = ""
1414
slideshare = ""
1515
slides = ""

exampleSite/content/events/2017-ponyville/program/spike.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ talk_end_time = ""
88
title = "Adopting Pony Progress"
99
type = "talk"
1010
speakers = ["spike"]
11-
youtube = ""
11+
youtube = "emGKB8TABvI"
1212
vimeo = ""
1313
speakerdeck = ""
1414
slideshare = ""

exampleSite/data/events/2017-ponyville.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: 2017-ponyville
22
year: "2017"
33
city: "Ponyville"
44
friendly: "2017-ponyville"
5-
startdate: 2017-07-16
6-
enddate: 2017-07-17
5+
startdate: 2017-11-16
6+
enddate: 2017-11-17
77
cfp_date_start: 2017-03-01
88
cfp_date_end: 2017-06-15
99
cfp_date_announce: 2017-01-01

layouts/program/single.html

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,28 @@ <h2>Program</h2>
1313
{{- if eq (index (split (.Permalink | relURL) "/") 2) $e.name -}}
1414
{{- $.Scratch.Set "base_file_name" .File.BaseFileName -}}
1515
{{- $.Scratch.Set .File.BaseFileName .Title -}}
16+
{{- with .Params.vimeo -}}
17+
{{- $.Scratch.Set (printf "%s-video_link" ($.Scratch.Get "base_file_name")) (printf "https://player.vimeo.com/video/%s" .) }}
18+
{{- end -}}
19+
{{- with .Params.youtube -}}
20+
{{- $.Scratch.Set (printf "%s-video_link" ($.Scratch.Get "base_file_name")) (printf "https://www.youtube.com/embed/%s" .) }}
21+
{{- end -}}
22+
{{- with .Params.speakerdeck -}}
23+
{{- $.Scratch.Set (printf "%s-slides_link" ($.Scratch.Get "base_file_name")) . }}
24+
{{- end -}}
25+
{{- with .Params.slideshare -}}
26+
{{- $.Scratch.Set (printf "%s-slides_link" ($.Scratch.Get "base_file_name")) . }}
27+
{{- end -}}
28+
{{- with .Params.googleslides -}}
29+
{{- $.Scratch.Set (printf "%s-slides_link" ($.Scratch.Get "base_file_name")) (printf "https://docs.google.com/presentation/d/%s" .) }}
30+
{{- end -}}
31+
{{- with .Params.pdf -}}
32+
{{- $.Scratch.Set (printf "%s-slides_link" ($.Scratch.Get "base_file_name")) . }}
33+
{{- end -}}
34+
{{- with .Params.slides -}}
35+
{{- $.Scratch.Set (printf "%s-slides_link" ($.Scratch.Get "base_file_name")) . }}
36+
{{- end -}}
37+
1638
{{- if isset .Params "speakers" -}}
1739
{{- if ne .Params.speakers "" -}}
1840
{{- $.Scratch.Set "speaker_len" (.Params.speakers | len) -}}
@@ -89,7 +111,10 @@ <h5 class="mb-0">
89111
{{ $.Scratch.Get (printf "%s-speaker" .title) }}
90112
-
91113
{{ $.Scratch.Get .title }}
92-
</a><br/>
114+
</a>
115+
{{- with ($.Scratch.Get (printf "%s-video_link" .title)) -}}<a href="{{ . }}"><i class="fa fa-video-camera" aria-hidden="true"></i></a>&nbsp;{{- end -}}
116+
{{- with ($.Scratch.Get (printf "%s-slides_link" .title)) -}}<a href="{{ . }}"><i class="fa fa-file-powerpoint-o" aria-hidden="true"></i></a>&nbsp;{{- end -}}
117+
<br/>
93118
{{- else if eq .type "ignite" -}}
94119
{{ .title }}
95120
<!-- do ignite stuff here -->
@@ -104,7 +129,9 @@ <h5 class="mb-0">
104129
<li>
105130
<a href="/events/{{ $e.name}}/program/{{ .title }}">{{ $.Scratch.Get (printf "%s-speaker" .title) }}
106131
-
107-
{{ $.Scratch.Get .title }}</a>
132+
{{ $.Scratch.Get .title }}</a>&nbsp;
133+
{{- with ($.Scratch.Get (printf "%s-video_link" .title)) -}}<a href="{{ . }}"><i class="fa fa-video-camera" aria-hidden="true"></i></a>&nbsp;{{- end -}}
134+
{{- with ($.Scratch.Get (printf "%s-slides_link" .title)) -}}<a href="{{ . }}"><i class="fa fa-file-powerpoint-o" aria-hidden="true"></i></a>&nbsp;{{- end -}}
108135
</li>
109136
{{- else -}}
110137
<li>

0 commit comments

Comments
 (0)