Feature request / Bug: Display Category name on category pages

Currently, micro.blog doesn’t show the Category name as a Heading in category page views, in any theme. There are two issues with this:

  • Someone landing on a category page link directly would have missing context. No typical user looks at the URL.
  • If the category page is linked in the menu, it doesn’t highlight itself as selected to provide context either.

I think the Category name should be displayed as a Heading by default.

Also, how can I display that for now on my micro blog anyway? I use the Marfa theme if that’s relevant.

Ideally, I think there should also be an optional description text for each Category to allow bloggers to explain a bit about what the category is tailored for, the kind @Moondeer has added on his microblog. How do I add that Jason?

1 Like

Start by looking at my theme code, I made it a public repo here.

I’ve been engrossed in the digital art I’m playing around with but I will check back in and get you the rest of the way there.

If I remember correctly, it takes two things:

  1. markdown files for the categories (you can actually control the front matter for categories, look under “content” I believe in the structure).
  2. A Hugo template that makes use if the additional data made available by the category content files.

Thanks, can I show the category name as a Heading the same way or is there an easier way?

A good place for that is probably to add in the same template that is making use of the description. I just chose not to have a heading because of how I was using the navigation menu styling to convey the category.

Thanks. Okay so I’m confused and could use more specific directions. I’m using the Marfa theme for micro.jatan.space. How do I edit the theme file for it to know what my category descriptions are and where do I put said descriptions like you have on GitHub? My goal is to show the category name on pages along with a one-liner description. But I suppose it’s too complicated for me at this point. I really wish this was a micro.blog default option.

1 Like

I’ll get back to you on this a little later. Gotta wake up a little and refresh my memory.

Okay, so assuming you have your per category front matter in place content/categories/my-category-name/_index.md

The file in my theme doing the retrieval is layouts/_default/taxonomy.html

My per category descriptions are in the markdown files beneath the front matter block. taxonomy.html accesses these as .Content. The taxonomy template is basically a specialization of the list template so you could probably mimic layouts/partials/post-list.html for the rest of the page after putting in you category stuff.

Update: and I don’t have the category names showing my theme but you should be able to access whatever is in the category’s front matter like .Title

1 Like