simoncor.net/themes/hugo-coder/layouts/partials/posts/series.html

31 lines
1.2 KiB
HTML
Raw Normal View History

2020-07-16 22:43:30 +02:00
{{ $currentPageUrl := .RelPermalink }}
{{ if .Params.series }}
<section class="see-also">
{{ range .Params.series }}
2024-08-26 17:13:18 +02:00
{{ $name := . | anchorize }}
2020-07-16 22:43:30 +02:00
{{ $series := index $.Site.Taxonomies.series $name }}
{{ if gt (len $series.Pages) 1 }}
2024-08-26 17:13:18 +02:00
<h3 id="{{ i18n "see_also" | default "See also in" | anchorize }}-{{ anchorize . | safeURL }}">
{{ i18n "see_also" | default "See also in" }} {{ . }}
<a class="heading-link" href="#{{ i18n "see_also" | default "See also in" | anchorize }}-{{ anchorize . | safeURL }}">
<i class="fa-solid fa-link" aria-hidden="true" title="{{ i18n "link_to_heading" | default "Link to heading" }}"></i>
<span class="sr-only">{{ i18n "link_to_heading" | default "Link to heading" }}</span>
</a>
</h3>
2020-07-16 22:43:30 +02:00
<nav>
<ul>
{{ $maxItems := $.Site.Params.maxSeeAlsoItems | default 5 }}
{{ range first (add $maxItems 1) $series.Pages }}
{{ if ne .RelPermalink $currentPageUrl }}
<li>
2024-08-26 17:13:18 +02:00
<a href="{{ .Params.externalLink | default .RelPermalink }}">{{ .Title }}</a>
2020-07-16 22:43:30 +02:00
</li>
{{ end }}
{{ end }}
</ul>
</nav>
{{ end }}
{{ end }}
</section>
{{ end }}