blog/layouts/partials/see-also-series-list.html

35 lines
1.5 KiB
HTML
Raw Permalink Normal View History

2022-06-25 08:47:06 +01:00
{{ if .Params.series }}
<section>
<h4 class="see-also">{{ i18n "seeAlso" }}</h4>
<ul>
{{ $series_taxonomy_name := "series" }}
{{ range $taxonomy_term, $taxonomy := .Site.Taxonomies }}
{{ if eq $taxonomy_term $series_taxonomy_name }}
{{ with $.Site.GetPage (printf "/%s" $taxonomy_term) }}
{{ range $key, $value := $taxonomy }}
{{ if eq $key $.Params.series }}
{{ range $value.Pages }}
{{ if ne .File.UniqueID $.File.UniqueID }}
<li hugo-nav="{{ .RelPermalink}}">
<a href="{{ .Permalink}}">{{ .LinkTitle }}</a>
</li>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ if $.Site.Params.showRelatedPosts }}
{{ $related := $.Site.RegularPages.Related . | first 2 }}
{{ with $related }}
{{ range . }}
<li>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</li>
{{ end }}
{{ end }}
{{ end }}
</ul>
</section>
{{ end }}