sblg – simple off-line blog utility

Version 0.4.11, 2017-11-10

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

Tips and Tricks: Fancy Navigation

Posted by
Kristaps Dzonsons
on

sblg's ability to fill in <nav data-sblg-nav="1" /> is fairly limited, but after version 0.0.12, you can specify exactly how you want to fill in navigation entries.

Prior to this, navigation looked as follows after being run through the system:

<nav data-sblg-nav="1"> <ul> <li>date: <a href="source">title</a></li> </ul> </nav>

Now, one can specify the <nav data-sblg-navcontent="1"> attribute and allow the element's contents be filled in with keyword substitution. Using, for example, the article7 parameter, you can have a custom navigation entry consisting of an image or otherwise!

<nav data-sblg-nav="1" data-sblg-navcontent="1"> <a href="${sblg-base}.html"> <figure><img src="${sblg-base}.png" /><figcaption>${sblg-title}</figcaption></figure> </a> </nav>

This will have navigation consist of a list of figures with images set to the filename base.

Note: prior to version 0.2.1, these tags were simply (e.g.) base instead of sblg-base. The extra sblg- was added to prevent namespace issues.