podcast-mod/layouts/podcast/section.html.html

40 lines
1.3 KiB
HTML
Raw Normal View History

2024-10-26 08:19:41 +00:00
<header><h1>{{ printf (T "welcome") .Title }}</h1></header>
<nav>
2024-10-21 06:50:06 +00:00
{{- $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 -}}
2024-10-26 08:19:41 +00:00
<section>
<h2>
{{- printf "%s%s" (T "seasons" | strings.FirstUpper) (T "colon") -}}
</h2>
2024-10-21 06:50:06 +00:00
{{- $season_lst = collections.Sort $season_lst "number" "asc" -}}
{{- end -}}
{{- range $season_lst -}}
2024-10-26 08:19:41 +00:00
<article>
<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>
</article>
2024-10-21 06:50:06 +00:00
{{- end -}}
2024-10-26 08:19:41 +00:00
</section>
<section>
<h2>
{{- printf "%s%s" (T "episodes" | strings.FirstUpper ) (T "colon") -}}
</h2>
2024-10-21 06:50:06 +00:00
{{ range .RegularPagesRecursive }}
2024-10-26 08:19:41 +00:00
<article>
<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>
</article>
2024-10-12 15:26:17 +00:00
{{ end }}
2024-10-26 08:19:41 +00:00
</section>
</nav>