💻

Taggregation

I'm pretty pleased with myself right now. I suddenly had the idea to write separate posts on whatever subjects … diet, work, books, music … and then compile them together to form my weeknotes.

I tend to compartmentalise into sections like this anyway, so the outcome should be similar, but this system will also allow themes to be browsed in isolation, without being cross-contaminated with other topics.

It was easy enough to implement in 11ty:

  1. Add a tag (taggregate) to the category posts.
  2. Add year and week frontmatter properties to the weeknote post and category posts.
  3. Make a new template extending the blog layout. It contains a block that iterated over collections.taggregate and, if the year and date match the current post's frontmatter, the content is rendered.

One issue I'm already aware of is that this limits my ability to use hierarchical headings within sections: I can't know if the starting point is an h1 in a single post, or an h2 in a weeknotes post. There are various ways around this, but I'm only going to think about those if they really become necessary. For now I'll just follow the content-wise restriction of having short posts with a flat structure.

END