Files
hotdog-cms/packs/series/pack.yaml
T
jcoffey-dev 6f1fe0ac43
ci / go (pull_request) Successful in 48s
ci / editor-ui (pull_request) Successful in 1m11s
Three packs: breadcrumbs, author box and series
breadcrumbs puts a Home › Articles › This page trail above a page's title
and gives search engines the same trail (BreadcrumbList) once installed.
author-box shows who wrote an article, at its end, from data/authors.yaml:
the author its front matter names, by id or name, else the site's author.
series shows "Part 2 of 5" in a series, every part, and the previous and
next part; parts follow their part: numbers, or go oldest first.

Two template functions they're built on: trail . (the pages above a page,
by address) and series . (a page's series, in reading order).
2026-10-14 13:28:35 -07:00

30 lines
1011 B
YAML

name: series
version: 1.0.0
title: Series
description: Articles in parts, with "Part 2 of 5", every part listed, and links to the previous and next part.
license: MIT
author: Coffey Labs LLC
notes: |
Give every article in a series the same series: in its front matter:
---
title: "Sourdough basics: feeding your starter"
date: 2027-01-12
series: Sourdough basics
part: 2 # optional; without it, parts go oldest first
---
Then add this line to layouts/article.html, where the box should go
(above {{ .Content }}, or after it):
{{ template "series" . }}
It shows only on articles in a series of two parts or more. Parts are in
the order of their part: numbers when every part has one, otherwise oldest
first.
To give each series a page listing its parts, add series to taxonomies:
in site.yaml (taxonomies: [tags, series]); the box then links the series'
name to it. Leave commas out of series names if you do, since a comma
separates values there.