podcast-mod/layouts/podcast/section.html.html
Florian Maury bd18ab9792 blip
2024-10-21 08:50:06 +02:00

25 lines
1.1 KiB
HTML

<h1>{{ printf (T "welcome") .Title }}</h1>
{{- $season_cnt := 0 -}}
{{- $season_lst := slice -}}
{{- range .Sections -}}
{{- if eq .Type "season" -}}
{{- $season_cnt = add $season_cnt 1 -}}
{{- $season_lst = collections.Append (dict "number" .Params.season.number "title" .Params.season.title "object" .) $season_lst -}}
{{- end -}}
{{- end -}}
{{- if gt $season_cnt 0 -}}
<h2>{{- T "seasons" | strings.FirstUpper -}}</h2>
{{- $season_lst = collections.Sort $season_lst "number" "asc" -}}
{{- end -}}
{{- range $season_lst -}}
<p><a href="{{- (collections.Index . "object").RelPermalink -}}">{{- printf "%s %d%s %s" (T "season" | strings.FirstUpper) (collections.Index . "number") (T "colon") (collections.Index . "title") -}}</a></p>
{{- end -}}
{{- printf "%s%s" (T "episodes" | strings.FirstUpper ) (T "colon") -}}
{{ range .RegularPagesRecursive }}
<p><a href="{{- .RelPermalink -}}">
{{- if .Params.season -}}
{{- printf "%s %d%s " (T "season" | strings.FirstUpper) (collections.Index .Params.season "number") (T "colon") -}}
{{- end -}}
{{- .Title -}}
</a></p>
{{ end }}