Postlist is a Micro.blog plugin that will add a short-code allowing you to a list of posts to a page, similar to Bear blog’s posts macro. The list of posts can be filtered to those of a specific category, and displayed either in chronological or alphabetical order.
Once installed, a post list can be added to a post or page by using the following short-code:
{{< postlist >}}
This will produce a list of all posts — both with and without titles — ordered in reverse chronological order.
Use the categories
attribute to only show posts that match a given category:
{{< postlist categories="Cheatsheet" >}}
Category names are case sensitive, and must match the name of the category as entered in Micro.blog. Multiple categories can be specified with commas, and a post must be in each one in order to appear in the post list.
{{< postlist categories="Cheatsheet,Git" >}}
By default, post lists are appear in reverse chronological order (newest posts appears on the top). If you want to order your posts in alphabetical order, from A to Z, you can set the order
attribute to alpha
:
{{< postlist order="alpha" >}}
For those that are familiar with Hugo templates, this uses link title ordering, which loosely corresponds with the title, or the first few words of a titleless post.
Post lists are rendered as an unordered lists with the postlist
class:
<ul class="postlist">
<li><a href="...">Item 1</a></li>
<li><a href="...">Item 2</a></li>
</ul>
The default CSS sets the list style to none
and removes the leading padding, but otherwise keeps the list unstyled. Post lists can therefore be restyled by adding a ul.postlist
CSS rule.
Any feedback — bugs, feature suggestions, etc. — on this plugin is welcomed. Probably the best place to raise them is by creating an issue on GitHub. Alternatively, you can hit me up on Micro.blog.