diff --git a/themes/devopsdays-theme/layouts/partials/program.html b/themes/devopsdays-theme/layouts/partials/program.html new file mode 100644 index 00000000000..d00aa320e6c --- /dev/null +++ b/themes/devopsdays-theme/layouts/partials/program.html @@ -0,0 +1,243 @@ + {{- $.Scratch.Set "first" "true" -}} + {{- with .Params.icons -}} + {{- $.Scratch.Set "icons" (. | upper ) -}} + {{- end -}} + {{- $e := partial "functions/get-event-data" . -}} + {{- $p := index $.Site.Data.events (index (split (.Permalink | relURL) "/") 2) "program" -}} +{{ if eq $p nil }} + {{ $p = $e }} +{{ end }} + {{- if $e.startdate -}} + {{/* {{- range where $.Site.Pages "Type" "talk" -}} */}} + {{ if (where (readDir (printf "content/events/%s/" $e.name)) "Name" "program") }} + {{ range os.ReadDir (printf "content/events/%s/program/" $e.name) }} + {{ $filename := (printf "/events/%s/program/%s" $e.name .Name) }} + {{/* {{ with $.Site.GetPage (printf "content/events/2022-chicago/program/%s" .Name) }} */}} + {{ with $.Site.GetPage $filename }} + {{/* {{- $talk_path := split .File.Path .Site.Params.PathSeparator -}} */}} + {{- 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.notist -}} + {{- $.Scratch.Set (printf "%s-slides_link" ($.Scratch.Get "base_file_name")) (printf "https://noti.st/%s" .) }} + {{- end -}} + {{- with .Params.slideslive -}} + {{- $.Scratch.Set (printf "%s-slides_link" ($.Scratch.Get "base_file_name")) (printf "https://slideslive.com/%s" .) }} + {{- 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) -}} + {{- $.Scratch.Set "speaker_count" 0 -}} + {{- end -}} + {{- end -}} + {{- range .Params.speakers -}} + {{- $.Scratch.Set "speaker_count" (add ($.Scratch.Get "speaker_count") 1) -}} + {{- $.Scratch.Set "speakername" . -}} + {{/* {{- range where $.Site.Pages "Type" "speaker" -}} + {{- if eq (index (split (.Permalink | relURL) "/") 2) $e.name -}} */}} + {{ if (where (readDir (printf "content/events/%s/" $e.name)) "Name" "speakers") }} + {{ range os.ReadDir (printf "content/events/%s/speakers/" $e.name) }} + {{ $filename := (printf "/events/%s/speakers/%s" $e.name .Name) }} + {{ with $.Site.GetPage $filename }} + {{- if eq .File.BaseFileName ($.Scratch.Get "speakername") -}} + {{- $.Scratch.Add (printf "%s-speaker" ($.Scratch.Get "base_file_name")) .Title -}} + {{- if ne ($.Scratch.Get "speaker_count") ($.Scratch.Get "speaker_len") -}} + {{- $.Scratch.Add (printf "%s-speaker" ($.Scratch.Get "base_file_name")) ", " -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + + {{- end -}} + {{- end -}} + {{- end -}} + + + {{- with $p -}} + {{- range .program -}} + {{- $.Scratch.SetInMap "dates" .date .date -}} + {{- end -}} + {{- end -}} + + {{- if or $e.timeoffset $e.timezone -}} + + {{- end -}} + {{- if $e.timezone -}} + + {{- end -}} +
+
+
+ {{- range ($.Scratch.GetSortedMapValues "dates") -}} + {{- $.Scratch.Set "date" . -}} + {{- with $p -}} + {{- if .program -}} +
+ +
+
+
+
+ {{- $program := (where .program "date" ($.Scratch.Get "date")) -}} + {{- $program_len := (len $program) -}} + {{- $.Scratch.Set "program_len" $program_len -}} + {{- $.Scratch.Set "program_counter" 0 -}} + {{- range where .program "date" ($.Scratch.Get "date") -}} + {{- $.Scratch.Set "program_counter" (add ($.Scratch.Get "program_counter") 1) -}} +
+
+ {{ .start_time }} + - + {{ .end_time }} + {{- if $e.timezone -}} +   + {{- end -}} + {{- if or $e.timeoffset $e.timezone -}} +
+ {{- if $e.timeoffset -}} + + {{- end -}} + {{- if not $e.timeoffset -}} + + {{- end -}} + + {{- end -}} +
+
+ {{- if eq .type "custom" -}} + {{- if .custom_url -}} + {{ .title }}
+ {{- else -}} + {{ .title }}
+ {{- end -}} + {{- if .comments -}} + {{ .comments | markdownify }}
+ {{- end -}} + {{- else if or (eq .type "talk") (eq .type "workshop") -}} + {{- if .custom_url -}} + {{ $.Scratch.Get (printf "%s-speaker" .title) }} - {{ $.Scratch.Get .title }}
+ {{- else -}} + {{ $.Scratch.Get (printf "%s-speaker" .title) }} - {{ $.Scratch.Get .title }}
+ {{- end -}} + {{- if eq ($.Scratch.Get "icons") "TRUE" -}} + {{- with ($.Scratch.Get (printf "%s-video_link" .title)) -}}  {{- end -}} + {{- with ($.Scratch.Get (printf "%s-slides_link" .title)) -}}  {{- end -}} + {{- end -}} + {{- if .comments -}} + {{ .comments | markdownify }}
+ {{- end -}} + {{- else if eq .type "ignite" -}} + {{ .title }} + +
    + {{- if .block -}} + {{- $block := .block -}} + {{- range $p.ignites -}} + {{- if eq .block $block -}} +
  • + {{ $.Scratch.Get (printf "%s-speaker" .title) }} - {{ $.Scratch.Get .title }} + {{- if eq ($.Scratch.Get "icons") "TRUE" -}} + {{- with ($.Scratch.Get (printf "%s-video_link" .title)) -}}  {{- end -}} + {{- with ($.Scratch.Get (printf "%s-slides_link" .title)) -}}  {{- end -}} + {{- end -}} +
  • + {{- end -}} + {{- end -}} + {{- else -}} + {{- range where $p.ignites "date" ($.Scratch.Get "date") -}} + {{- if not .block -}} +
  • + {{ $.Scratch.Get (printf "%s-speaker" .title) }} - {{ $.Scratch.Get .title }} + {{- if eq ($.Scratch.Get "icons") "TRUE" -}} + {{- with ($.Scratch.Get (printf "%s-video_link" .title)) -}}  {{- end -}} + {{- with ($.Scratch.Get (printf "%s-slides_link" .title)) -}}  {{- end -}} + {{- end -}} +
  • + {{- end -}} + {{- end -}} + {{- end -}} +
+ + + {{- else if (eq .type "open-space") -}} + {{- if .custom_url -}} + {{ .title }}
+ {{- else -}} + {{ .title }}
+ {{- end -}} + {{- else -}} + {{ .title }} + {{- end -}} +
+
+ {{- if eq (div ($.Scratch.Get "program_len") 2) ($.Scratch.Get "program_counter") -}} +
+
+ {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} +
+
+
+
+
+{{- end -}} +
+
+
+ + + +{{- end -}} \ No newline at end of file diff --git a/themes/devopsdays-theme/layouts/program/single.html b/themes/devopsdays-theme/layouts/program/single.html index 37a58174c5d..0f9f48ae513 100644 --- a/themes/devopsdays-theme/layouts/program/single.html +++ b/themes/devopsdays-theme/layouts/program/single.html @@ -1,269 +1,7 @@ {{ define "main" }} -

Program

+

{{ .Title }}

- {{ .Content }} - - - {{- $.Scratch.Set "first" "true" -}} - {{- with .Params.icons -}} - {{- $.Scratch.Set "icons" (. | upper ) -}} - {{- end -}} - - {{- $e := partial "functions/get-event-data" . -}} - - {{- $p := index $.Site.Data.events (index (split (.Permalink | relURL) "/") 2) "program" -}} - - -{{ if eq $p nil }} - {{ $p = $e }} -{{ end }} - - {{- if $e.startdate -}} - {{/* {{- range where $.Site.Pages "Type" "talk" -}} */}} - {{ if (where (readDir (printf "content/events/%s/" $e.name)) "Name" "program") }} - {{ range os.ReadDir (printf "content/events/%s/program/" $e.name) }} - {{ $filename := (printf "/events/%s/program/%s" $e.name .Name) }} - {{/* {{ with $.Site.GetPage (printf "content/events/2022-chicago/program/%s" .Name) }} */}} - {{ with $.Site.GetPage $filename }} - {{/* {{- $talk_path := split .File.Path .Site.Params.PathSeparator -}} */}} - {{- 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.notist -}} - {{- $.Scratch.Set (printf "%s-slides_link" ($.Scratch.Get "base_file_name")) (printf "https://noti.st/%s" .) }} - {{- end -}} - {{- with .Params.slideslive -}} - {{- $.Scratch.Set (printf "%s-slides_link" ($.Scratch.Get "base_file_name")) (printf "https://slideslive.com/%s" .) }} - {{- 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) -}} - {{- $.Scratch.Set "speaker_count" 0 -}} - {{- end -}} - {{- end -}} - {{- range .Params.speakers -}} - {{- $.Scratch.Set "speaker_count" (add ($.Scratch.Get "speaker_count") 1) -}} - {{- $.Scratch.Set "speakername" . -}} - {{/* {{- range where $.Site.Pages "Type" "speaker" -}} - {{- if eq (index (split (.Permalink | relURL) "/") 2) $e.name -}} */}} - {{ if (where (readDir (printf "content/events/%s/" $e.name)) "Name" "speakers") }} - {{ range os.ReadDir (printf "content/events/%s/speakers/" $e.name) }} - {{ $filename := (printf "/events/%s/speakers/%s" $e.name .Name) }} - {{ with $.Site.GetPage $filename }} - {{- if eq .File.BaseFileName ($.Scratch.Get "speakername") -}} - {{- $.Scratch.Add (printf "%s-speaker" ($.Scratch.Get "base_file_name")) .Title -}} - {{- if ne ($.Scratch.Get "speaker_count") ($.Scratch.Get "speaker_len") -}} - {{- $.Scratch.Add (printf "%s-speaker" ($.Scratch.Get "base_file_name")) ", " -}} - {{- end -}} - {{- end -}} - {{- end -}} - {{- end -}} - {{- end -}} - {{- end -}} - {{- end -}} - - {{- end -}} - {{- end -}} - {{- end -}} - - - {{- with $p -}} - {{- range .program -}} - {{- $.Scratch.SetInMap "dates" .date .date -}} - {{- end -}} - {{- end -}} - - - {{- if or $e.timeoffset $e.timezone -}} - - {{- end -}} - {{- if $e.timezone -}} - - {{- end -}} - -
-
-
- {{- range ($.Scratch.GetSortedMapValues "dates") -}} - {{- $.Scratch.Set "date" . -}} - {{- with $p -}} - {{- if .program -}} -
- - -
-
-
-
- {{- $program := (where .program "date" ($.Scratch.Get "date")) -}} - {{- $program_len := (len $program) -}} - {{- $.Scratch.Set "program_len" $program_len -}} - {{- $.Scratch.Set "program_counter" 0 -}} - {{- range where .program "date" ($.Scratch.Get "date") -}} - {{- $.Scratch.Set "program_counter" (add ($.Scratch.Get "program_counter") 1) -}} -
-
- {{ .start_time }} - - - {{ .end_time }} - {{- if $e.timezone -}} -   - {{- end -}} - {{- if or $e.timeoffset $e.timezone -}} -
- {{- if $e.timeoffset -}} - - {{- end -}} - {{- if not $e.timeoffset -}} - - {{- end -}} - - {{- end -}} -
-
- {{- if eq .type "custom" -}} - {{- if .custom_url -}} - {{ .title }}
- {{- else -}} - {{ .title }}
- {{- end -}} - {{- if .comments -}} - {{ .comments | markdownify }}
- {{- end -}} - {{- else if or (eq .type "talk") (eq .type "workshop") -}} - {{- if .custom_url -}} - {{ $.Scratch.Get (printf "%s-speaker" .title) }} - {{ $.Scratch.Get .title }}
- {{- else -}} - {{ $.Scratch.Get (printf "%s-speaker" .title) }} - {{ $.Scratch.Get .title }}
- {{- end -}} - {{- if eq ($.Scratch.Get "icons") "TRUE" -}} - {{- with ($.Scratch.Get (printf "%s-video_link" .title)) -}}  {{- end -}} - {{- with ($.Scratch.Get (printf "%s-slides_link" .title)) -}}  {{- end -}} - {{- end -}} - {{- if .comments -}} - {{ .comments | markdownify }}
- {{- end -}} - - {{- else if eq .type "ignite" -}} - {{ .title }} - -
    - {{- if .block -}} - {{- $block := .block -}} - {{- range $p.ignites -}} - {{- if eq .block $block -}} -
  • - {{ $.Scratch.Get (printf "%s-speaker" .title) }} - {{ $.Scratch.Get .title }} - {{- if eq ($.Scratch.Get "icons") "TRUE" -}} - {{- with ($.Scratch.Get (printf "%s-video_link" .title)) -}}  {{- end -}} - {{- with ($.Scratch.Get (printf "%s-slides_link" .title)) -}}  {{- end -}} - {{- end -}} - -
  • - {{- end -}} - {{- end -}} - {{- else -}} - {{- range where $p.ignites "date" ($.Scratch.Get "date") -}} - {{- if not .block -}} -
  • - {{ $.Scratch.Get (printf "%s-speaker" .title) }} - {{ $.Scratch.Get .title }} - {{- if eq ($.Scratch.Get "icons") "TRUE" -}} - {{- with ($.Scratch.Get (printf "%s-video_link" .title)) -}}  {{- end -}} - {{- with ($.Scratch.Get (printf "%s-slides_link" .title)) -}}  {{- end -}} - {{- end -}} - -
  • - {{- end -}} - {{- end -}} - {{- end -}} - - - -
- - - - - - {{- else if (eq .type "open-space") -}} - {{- if .custom_url -}} - {{ .title }}
- {{- else -}} - {{ .title }}
- {{- end -}} - {{- else -}} - {{ .title }} - {{- end -}} -
-
- {{- if eq (div ($.Scratch.Get "program_len") 2) ($.Scratch.Get "program_counter") -}} -
-
- {{- end -}} - {{- end -}} - {{- end -}} - {{- end -}} -
-
-
-
-
-{{- end -}} -
-
-
- - - -{{- end -}} +{{ .Content }} +{{ partial "program.html" . }} {{ partial "sponsors.html" . }} {{ end }} diff --git a/themes/devopsdays-theme/layouts/shortcodes/event_program.html b/themes/devopsdays-theme/layouts/shortcodes/event_program.html new file mode 100644 index 00000000000..e72e35bb47b --- /dev/null +++ b/themes/devopsdays-theme/layouts/shortcodes/event_program.html @@ -0,0 +1,4 @@ +{{- $e := partial "functions/get-event-data" . -}} +{{- $s := .Site.GetPage (printf "events/%s/program" $e.name) -}} +

{{$s.Title}}

+{{ partial "program.html" $s }}