adityatelange / hugo-PaperMod

A fast, clean, responsive Hugo theme.
https://adityatelange.github.io/hugo-PaperMod/
MIT License
9.83k stars 2.65k forks source link

[Feature Request] List all articles of a series #464

Open marioortizmanero opened 3 years ago

marioortizmanero commented 3 years ago

PaperMod includes by default the taxonomy "series". It would be great if, when in an article that is part of a series, it indicated so, and listed the rest of the articles. For example (https://fasterthanli.me/series/making-our-own-executable-packer/part-1):

image

hannagoodbar commented 2 years ago

I did something similar adapted from https://npf.io/2014/08/making-it-a-series/.

{{/* From: https://npf.io/2014/08/making-it-a-series/ */}}
{{- if .Params.series }}
    {{- $name := index .Params.series 0 }}
    <p><a href="" id="series"></a>Part of the <em>{{$name}}</em> series:</p>
    {{- $name := $name | urlize }}
    {{- $series := index .Site.Taxonomies.series $name }}
    <ol reversed class="series">
    {{- range $series.Pages }}
      <li><a href="{{.Permalink}}">{{.LinkTitle}}</a>,&#32;
        {{- .Date.Format .Site.Params.DateFormat -}}
      </li>
    {{- end }}
    </ol>
{{- end }}
    {{- if .Params.series }}
    {{- partial "series-posts.html" . -}}
    {{- end }}
series: ["Making our own executable packer"]