Skip to main content

Blog Tags

I implemented the tag system for this website. You can see the tag for this blog entry in the secondary column. The blog entry index shows an index of tags annotated with the number of entries per tag. Click on a tag to see the index of blog entries for a tag. An RSS feed is available for each tag.

The tags are hierarchical, in category:subtag format. This allows items to be browsed by broad category as well as narrow subtag. For example, this blog entry is tagged with project:website. The project category shows all blog entries about projects, while the website subtag only shows the entries about this website.

Design History

When I first designed this website, I planned on implementing a fully hierarchical category system. The primary motivation was to provide a user-friendly way for people to browse articles and blog entries by category, as well as subscribe to them via RSS. For example, an article that uses Haskell could be included in the following category:

development.programming.functional.haskell

Somebody who is only interested in Haskell could subscriber to the haskell feed, while somebody is is interested in functional programming in general could subscribe to the functional feed, for example.

I eventually realized that the drawbacks of the complexity of such a system outweigh the benefits. I considered just using tags like other websites use, but I tried to design a compromise. In the implemented tag system, each tag has exactly two levels: a category and a “subtag.” I think that this design is a good compromise because it provides some flexibility without too much complexity.

One aspect of the tag system that I was unsure of is the syntax. The characters that may be used in a URL without escaping are quite limited. I ended up choosing the colon (:) to separate the category and subtag. This choice is questionable, but it seems to work fine.

In the initial design, tags (categories) had labels. While the identifiers were used in URLs, labels provided natural English in rendered HTML and RSS feeds. I ended up scrapping this idea because I think that just using the tag identifiers everywhere is easier to understand.

I will see how well this implementation works. I may improve upon it in the future, but I really hope to avoid changing URLs, especially for RSS feeds.

Author

Travis Cardwell

Published

Tags