sblg – static blog utility

v0.5.3, 2019-08-16

This is an example of an individual article. It consists of a template (article.xml) merged with article contents.

Tips and Tricks: Tag Indexes

Posted by
Kristaps Dzonsons

Tags are useful for organising your content. As of version 0.1.1, you can specify tags for each article as follows:

<article data-sblg-article="1" data-sblg-tags="foo bar"> <header> <h1>Title</h1> <address>Kristaps Dzonsons</address> <time datetime="2013-01-01">1 January, 2013</time> </header> <aside> The article's <b>summary</b> </aside> <code data-sblg-tags="baz">Mu.</code> </article>

The <article data-sblg-tags=""> attribute indicates the tags of an article. In this article's case, that's foo, bar, and baz. You can have as many space-separated tags as you'd like.

Once you've added the tags, you can use them when generating <nav> entries in the blog amalgation. This is used in the index.html page of this site.

<nav data-sblg-nav="1" data-sblg-navtag="foo" />

The above navigation element will only display entries with the foo tag. If you have multiple space-separated words in the data-sblg-navtag attribute, it will OR them together when selecting.