This blog, which is now generated with Hugo, uses the permalink structure /:year/:month/:slug
(the slug is a url-safe version of the title). There are also “archive” pages, which list the articles posted in a given
month or year. These pages have a permalink structure that compliments the post permalinks: /:year/:month
and /:year
respectively.
Back when this blog was generated with Jekyll, I used
a plugin to generate the archive pages but there is no such
mechanism in Hugo. It is possible to use taxonomies
to accomplish this, but it involves defining a taxonomy for each year in the Hugo config, creating a corresponding
layout and also adding redundant frontmatter to each post.
As an alternative, I created 2 new “sections” (top level subfolders in the content folder): archy
and archm
. archy
contains one file per year and archm
contains one file per month. These files can be generated automatically
(see below).