Using categories

Micro.blog hosted blogs can tag their posts with categories. Categories can help you organize your content. And since categories get their own RSS feed, readers can even subscribe to specific content streams.

Creating Categories

You can create a new category for your blog under Posts → Categories, and those categories will appear when editing a post or when creating a longer post with a title. We hide the category options be default when you are composing a short post, but in the new macOS app you can show the categories by choosing View → Categories. A list of your categories will appear at the top of Archive on your blog for readers to browse.

Adding categories to your navigation

If you want to link to a category in your main navigation, create a new page under Posts → Pages. Title your new page and then put the URL to the category in your contents, e.g. https://yourdomain.com/categories/something/. Keep “Include this page in your blog navigation” checked and click Add Page.

Click and drag the three gray lines to reorder the pages in your navigation menu.

Auto-filter posts by length, text, or even emoji

There’s a powerful filter mechanism inside Micro.blog for automatically assigning categories based on criteria in the post. For example, you can assign a post to a Photos category if the post includes an img tag. Or if the post includes the :books: emoji, it can be assigned to a Books category. You can even assign categories based on post length.

To create new filters, go to Posts → Categories → Edit Filters.

By default, filters are applied to new posts only. To also apply the filter to all posts, there’s a new “Run Filter” button. For blogs with thousands of posts, make sure to give Micro.blog a little time to update all your posts and publish them to your blog.

API for categories

Categories support is in both the MetaWeblog XML-RPC API and the Micropub API. This means that categories work great with MarsEdit. Categories are also included in your default JSON Feed in the “tags” field.

Each category has its own RSS feed with the format:

https://yourdomain.com/categories/something/feed.xml

1 Like

Looks like some of your emojis likely got chomped in the transition as well.

Is there any way to use an if for categories.

For example I want to use the Hugo {{ if in .Params.categories "link-posts" }} have a specific version of the title, however it doesn’t seem to work.

Try doing something like

{{ printf “<!-- categories: %v -->” .Params.categories | safeHTML }}

and check the generated HTML comment in your page source to make sure the “Link Posts” version isn’t what you are matching against.

Hi, how can I show always have the view to select categories shown by default when composing posts? Both on the Web app and macOS app. I tend to categorize almost every post as I’m using micro.blog as a curated collection of things. And not all such categories can be automated filters. So is there a way to always show that view to select categories?

According to the latest update the categories should always show in the Mac app so long as they’ve been previously created; at least that’s how I interpreted that (I don’t have a Mac so can’t test). For the web, there is no such setting at the moment; you either use the menu button on the top right or they appear automatically when writing a longer post.

Thanks, I just tested the new macOS app for that feature. It shows the categories pane when editing a post you already assigned categories to, not for new posts.

Oh interesting. Does this method work at all?

Yeah this works, but I want to be able to have that view always visible by default. Currently, one needs to do that method every single time when posting.

1 Like

Filter rules still capital-sensitive. Any plans to make that change @manton?

Note: the “persistent category view” request has also been made on GitHub: