hugo-coder-fork/layouts/partials/posts/series.html

25 lines
747 B
HTML
Raw Permalink Normal View History

{{ $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 }}
2020-02-18 17:44:24 +00:00
<h3>More {{ . }} Articles</h3>
<nav>
2020-02-18 17:44:24 +00:00
<ul class="see-also-list">
{{ $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 }}