mirror of
https://github.com/13hannes11/hugo-coder-timeline.git
synced 2024-09-04 00:50:58 +02:00
Add see also section to posts footer (#152)
* Fix series list page title * Add see also section to posts footer
This commit is contained in:
committed by
Luiz F. A. de Prá
parent
da6f9e1389
commit
27e83b1e5a
24
layouts/partials/posts/series.html
Normal file
24
layouts/partials/posts/series.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{{ $currentPageUrl := .URL }}
|
||||
{{ if .Params.series }}
|
||||
<section class="see-also">
|
||||
{{ range .Params.series }}
|
||||
<h3>See also in {{ . }}</h3>
|
||||
{{ $name := . | urlize }}
|
||||
{{ $series := index $.Site.Taxonomies.series $name }}
|
||||
{{ if gt (len $series.Pages) 0 }}
|
||||
<nav>
|
||||
<ul>
|
||||
{{ $maxItems := $.Site.Params.maxSeeAlsoItems | default 5 }}
|
||||
{{ range first (add $maxItems 1) $series.Pages }}
|
||||
{{ if ne .URL $currentPageUrl }}
|
||||
<li>
|
||||
<a href="{{ .Params.ExternalLink | default .URL }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user