🍓 Berry House
← Back to Blog

Fixing Tags, Categories, and RSS in Our Eleventy Blog

What broke, why it broke, and how we fixed it

Published on by [object Object]1 min read min read

Over a short QA pass, I found three regressions:

  • Tags pages were 404ing
  • Categories index existed but showed no categories
  • The RSS feed at /feed.xml was 404ing

Here’s how we addressed each one.

Tags 404

  • Problem: The template at src/tags.njk expected a collections.tagList for pagination, but no such collection was defined.
  • Fixes:
    • Added a tagList collection in .eleventy.js that reads tags from src/blog/**/*.md and de-duplicates by slug to avoid permalink collisions.
    • Added a tags index page src/tags/index.njk that lists all tags with counts.

Key code: .eleventy.js addCollection("tagList", ...) returns a unique, sorted list of tag names.

Categories empty

  • Problem: The index page at src/categories/index.njk expected collections.categoryList, which didn’t exist.
  • Fixes:
    • Added a categoryList collection in .eleventy.js by pulling the category frontmatter from posts.
    • Per-category archive pages are generated by src/categories.njk with pagination over the category list.
    • Resolved an output conflict by disabling a redundant src/category.njk (now permalink: false).

RSS 404

  • Problem: src/feed.xml referenced collections.posts and used an htmlToAbsoluteUrls filter that wasn’t defined yet. When collections or filter initialization failed, the feed failed to build.
  • Fixes:
    • Confirmed a posts collection sourcing from src/blog/**/*.md (sorted by date desc) in .eleventy.js.
    • Implemented a lightweight htmlToAbsoluteUrls filter to convert relative links in post content to absolute URLs using site.url.

Result

  • /tags/ works and lists tags; individual tag pages paginate correctly
  • /categories/ shows categories with counts and links to per-category pages
  • /feed.xml builds and includes the latest posts

If you want to extend this further, consider:

  • Adding tag or category descriptions
  • Hiding utility tags (already ignoring all, nav, post, posts)
  • Using a custom slug function if you need locale-specific slugs

Happy shipping!

Brennan Kenneth Brown

About Brennan Kenneth Brown

Queer Métis JAMstack developer, writer, and advocate for a human-centric web.

About 🍓 Berry House

Hi. We're here to help you create and share meaningful work and art with the world. Whether you're looking to amplify your writing or build an independent website, we're here to help.

Join the Berry House Newsletter

Get thoughtful essays and updates on digital writing, JAMstack, and the IndieWeb delivered to your inbox. No spam ever.

Related Posts

Responses

Loading webmentions...