07-Sep-2014
Tag support in Urubu 0.5
The biggest question I have with websites is: how should I organize content, so that visitors can easily find what they want? It is also the guiding question behind Urubu, and the reason I created it, as I didn't find what I wanted elsewhere.
At the top-level, I like using subdomains: instead of one big website, use dedicated websites for a specific topic or project, each on its own subdomain. This is easy with Urubu, because it is a snap to set up a new website. For example, www.myhdl.org used to have content for both users and developers. Now I have factored out the developer info into dev.myhdl.org. Likewise, my own professional content is on www.jandecaluwe.com, but for other projects I use subdomains such as music.jandecaluwe.com.
At the website level, Urubu is much more flexible than other static website generators that I know of, as the organization of each folder can be fully customized. For example, on the same website you can have a manual, a blog, and any kind of other useful content organization. Note that other website generators typically use a different tool for their manual, but the Urubu manual is developed with Urubu itself.
As a website grows, another popular technique become useful: tags. By tagging a content page with a number of keywords, the website generator can automatically generate a tag view per tag: a list of the content associated with that tag. This provides an easy way to find related content.
Urubu 0.5 introduces tag support. As I was thinking about the implementation and looking elsewhere for inspiration, my goal was to make this as intuitive as possible. After all, if "there should be one obvious way to do it", the ideal tool has zero configuration :-)
All you need to enable tag support is a tag.html
template in the _layouts
directory. Urubu automatically generates tag view pages and uses the tag
layout to render them.
Tag views are available as reference links for use in templates and markdown
content. For example, the /tag/urubu
id refers to the urubu tag. The
content is ordered according to date or modification date, most recent one
first.
Urubu also generates a reference link with the /tag
id that lists all tag
views. They are ordered according to the number of pages associated with the
tag. For maximum flexibility, you can use the corresponding tag
directory and
its index.md
file to define attributes such as the layout. This technique has
been used on the present site, to make the tags available as a dropdown menu in
the navbar.
You can see tag support in action on this very page and website. To style tags, I found Bootstrap buttons very convenient. For more detailed info about tag support, consult the Urubu manual.