Allow slides and recordings be linked to talks
This commit is contained in:
parent
4b4665a855
commit
399e503647
@ -4,4 +4,8 @@ date: {{ .Date }}
|
||||
draft: false
|
||||
authors: [ "unknown" ]
|
||||
when: {{ .Date }}
|
||||
slides:
|
||||
- data: <url>
|
||||
recordings:
|
||||
- data: <url>
|
||||
---
|
@ -32,6 +32,14 @@ other = "Datum přednášky"
|
||||
[talks-paginator-heading]
|
||||
other = "Nadcházející a proběhlé Talky"
|
||||
|
||||
[talks-slides]
|
||||
other = "Prezentace"
|
||||
|
||||
[talks-recording]
|
||||
one = "Záznam"
|
||||
few = "Záznamy"
|
||||
other = "Záznamy"
|
||||
|
||||
[tags]
|
||||
other = "Tagy"
|
||||
|
||||
|
@ -27,6 +27,13 @@ other = "Speaker"
|
||||
[talks-paginator-heading]
|
||||
other = "Upcoming and past Talks"
|
||||
|
||||
[talks-slides]
|
||||
other = "Slides"
|
||||
|
||||
[talks-recording]
|
||||
one = "Recording"
|
||||
other = "Recordings"
|
||||
|
||||
[tags]
|
||||
other = "Tags"
|
||||
|
||||
|
23
themes/patek/layouts/partials/linkedContent.html
Normal file
23
themes/patek/layouts/partials/linkedContent.html
Normal file
@ -0,0 +1,23 @@
|
||||
{{- range $i, $_ := .content -}}
|
||||
{{- $type := (default "link" .type) -}}
|
||||
{{- $desc := .desc -}}
|
||||
{{- if (eq (len $.content) 1) -}}
|
||||
{{- $desc = (default $.text $desc) -}}
|
||||
{{- else -}}
|
||||
{{- if (and (not (isset . "desc")) (not (eq $type "text"))) -}}{{- errorf "Missing description for content %s" .data -}}{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if (and (or (gt (len $.content) 1) (eq $type "text")) (eq $i 0)) -}}{{- $.text -}}: {{- end -}}
|
||||
{{- if (gt $i 0) -}}, {{ end -}}
|
||||
|
||||
{{- if (eq $type "link") -}}
|
||||
<a href="{{ .data }}" target="_blank" rel="noopener">{{ $desc }}</a>
|
||||
{{- else if (eq $type "text") -}}
|
||||
{{- .data -}}
|
||||
{{- else if (eq $type "resource") -}}
|
||||
{{- $resource := $.resources.GetMatch "fablab-experience.jpg" -}}
|
||||
<a href="{{ $resource.RelPermalink }}">{{ $desc }}</a>
|
||||
{{- else -}}
|
||||
{{- errorf "Unknown content type %s" $type -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
@ -5,4 +5,6 @@
|
||||
<p class="">
|
||||
{{- T "presenter" -}}: {{ range .Params.authors }}{{ with $.Site.GetPage (printf "authors/%s" .) }}<a class="separateWithCommas" href="{{ .Permalink }}">{{ .Title }}</a>{{ end }}{{ end }}
|
||||
</p>
|
||||
{{- with .Params.slides -}}<p>{{ partial "linkedContent" (dict "text" (T "talks-slides" (len .)) "content" . "resources" $.Page.Resources) }}</p>{{- end -}}
|
||||
{{- with .Params.recordings -}}<p>{{ partial "linkedContent" (dict "text" (T "talks-recording" (len .)) "content" . "resources" $.Page.Resources) }}</p>{{- end -}}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user