Custom category pages

I’ve done a fair bit of reading trying to see if this has been answered, but I can’t quite find anything.

Basically I would like my Micro.blog to have three streams (categories):

  • Blog posts
  • Micro posts - stream of consciousness stuff
  • Commonplace - like a commonplace book, or a collection of things I want to revisit (this could also probalby just be a page)

I understand that I can create a page that includes the category link, thus creating a page that I can also link to in navigation. Is there a way to customize that category landing page further, such as with description text? Is the only way to do that to build custom Hugo templates for the specific categories page?

(A secondary question is whether or not there is a way to have pages and sub pages? For instance if I wanted a page of various lists I maintain, and each list is a subpage. So lists would be at /lists and my list of favorite beanie babies would be at /lists/beaniebabies.)

Yes, it is possible using custom Hugo templates. Another approach is using client-side JavaScript to do the actual listing. A third way is with a custom Hugo shortcode.

Unfortunately, all three require some basic templating or scripting skills. :pensive: I can’t think of any way around that. (Someone might have already built a plug-in or template with support for this, though.)

Yes, you can change the path to a page to be /lists/beaniebabies/ or whatever you want. You can manually link to all the subpages on the page at /lists. The path to a page can be changed after creation; just go back and edit it.

1 Like

Thank you for the response!! I will give the subcategory setup a try.

I have the skills to template. I’m just trying to avoid getting distracted into template land as much as I can for now.

The easiest way to do most of what you’re talking about is take advantage of templates in Hugo and the ability for custom themes to put materials in the content folder like content/lists/beaniebabies.md. You can then set the type in the front matter and have layouts that are specific to that type.

I am currently working on a custom bookshelves page this very way (not “launched”, still need to mess with CSS and template, but visible here. This is done with a singe page in content/bookshelf.md with type:bookshelf and a template for layouts/bookshelf/single.html. I might break up the years though into pages under content/bookshelf/2021.md for example.

2 Likes