This repository has been archived on 2024-10-31. You can view files and clone it, but cannot push or open issues or pull requests.
Files
sophia.wtf/themes/hugo-coder/layouts/partials/posts/series.html
2022-11-03 21:23:41 -07:00

31 lines
1.2 KiB
HTML

{{ $currentPageUrl := .RelPermalink }}
{{ if .Params.series }}
<section class="see-also">
{{ range .Params.series }}
{{ $name := . | urlize }}
{{ $series := index $.Site.Taxonomies.series $name }}
{{ if gt (len $series.Pages) 1 }}
<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 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>
<nav>
<ul>
{{ $maxItems := $.Site.Params.maxSeeAlsoItems | default 5 }}
{{ range first (add $maxItems 1) $series.Pages }}
{{ if ne .RelPermalink $currentPageUrl }}
<li>
<a href="{{ .Params.externalLink | default .RelPermalink }}">{{ .Title }}</a>
</li>
{{ end }}
{{ end }}
</ul>
</nav>
{{ end }}
{{ end }}
</section>
{{ end }}