trwnh.com/unified.test.hugo/layouts/partials/components/series-list.html

34 lines
No EOL
1.5 KiB
HTML

{{- with .GetTerms "series" }}
{{- range $term, $weightedpages := . }}
<p class="series-hint">This post is part of a series: <a href="{{.Page.Permalink}}" class="series-link">{{.Page.LinkTitle}}</a></p>
<ol class="series-list">
{{- range $weightedpages.Pages.ByWeight.Reverse }}
<li class="series-post">
{{- if eq .File.UniqueID $.File.UniqueID -}}
{{- with .Params.series_part }}
<span class="series-post__part">Part {{.}}: </span>
{{- end }}
<span class="series-post__title current-post">{{.Title}}</span>
{{- else }}
{{- with .Params.series_part }}
<span class="series-post__part">Part {{.}}: </span>
{{- end }}
<a href="{{.Permalink}}" class="series-post__link"><span class="series-post__title">{{.Title}}</span></a>
{{- end }}
</li>
{{- end }}
</ol>
{{- end }}
{{- end }}
{{/* {{ $series := .Params.series }}
{{ $pages := where .Site.RegularPages "Params.series" $series }}
<p class="series-hint">This post is part of a series: <span class="series-title">{{$series}}</span></p>
<ol class="series-list">
{{ range sort $pages "Params.series_part" }}
{{ if eq .Permalink $.Permalink }}
<li class="series-post"><span class="series-post__part">Part {{.Params.series_part}}: </span><span class="series-post__title current-post">{{.Title}}</span></li>
{{ else }}
<li class="series-post"><span class="series-post__part">Part {{.Params.series_part}}: </span><a href="{{.Permalink}}" class="series-post__link"><span class="series-post__title">{{.Title}}</span></a></li>
{{ end }}
{{ end }}
</ol> */}}