Home | Blog | Contact |
this page is still being written - more and better text soon!
I've migrated my blog over to a SSG I wrote myself!
My experiences with Zola have been pretty positive, but I've run into a few minor issues that unfortunately cause my entire brain to grind to a halt. Obviously, the correct solution is to write my own generator.
There a few conflicting forces involved in writing a good blog. The majority of them have to do with how you form your URLs.
The most important rule of the web: don't break links. This means once a page is published, you can never change its path. You have to assume that someone has visited your site and bookmarked the page, or even worse, linked to it from their own site. Any change afterwards, and the next visit to that bookmark or link will yield the dreaded 404
. For your user's sake, this should be avoided at all costs.
A result of this: If you bake your site's taxonomy into its URLs, you can never reorganize. Once an article is posted, it's stuck at whatever URL it first appeared on.
Generated pages also suffer from this problem, but are much less critical. Readers are a lot less likely to link to them, and since they contain links to content, rather than the content itself, the information lost when a link breaks is less. Ideally, the URLs of generated pages should also be left alone once posted, but there is slightly more flexibility.
On the other hand, it's common while maintaining a site to want to reorganize your pages. A blog post might turn into a project page, you might want to add a collection of posts to a series, or you might want to hide a post from its parent listings without breaking existing links to it.
If your site's taxonomy is encoded in the pages' URLs, this is impossible: any reorganization must change the URLs, breaking any existing links.
I've settled on a compromise: contentful pages exist in a flat, fixed namespace, and generated pages exist in a taxonomic namespace, but are allowed to change.
Every contentful page in this site is assigned a slug: a concise, unique identifier. All posts are accessible by their slug at /page/<slug>
. This slug, and the corresponding path, is never allowed to change. The input files can be stored in any hierarchy in the content/pages
input directory, and their path has no effect on their location in the generated site: their URL is determined entirely by the slug
field in the page header.
Generated pages, on the other hand, can exist at any desired path, with the exception of a few reserved keywords at the root of the site (/page/
,/static/
, and /images/
, to name a few).