Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
marioortizmanero opened this issue Jul 7, 2021 · 1 comment
Open

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

marioortizmanero opened this issue Jul 7, 2021 · 1 comment

Comments

@marioortizmanero
Copy link

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
Copy link

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

  • Under your site create a layouts/partials folder.
  • Create the file layouts/partial/series-posts.html with these contents.
{{/* 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 }}
  • Create a layouts/_default folder.
  • Copy themes/papermod/layouts/_default/single.html to layouts/_default/single.html.
  • Edit layouts/_default/singlehtml. In my copy, I put the following in the footer section, just underneath <footer class="post-footer">.
    {{- if .Params.series }}
    {{- partial "series-posts.html" . -}}
    {{- end }}
  • To use, include the following in your post's front matter.
series: ["Making our own executable packer"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants