Carlos Fenollosa — Blog

Thoughts on science and tips for researchers who use computers

Bashblog now supports tags

February 27, 2014 — Carlos Fenollosa

Motivated by some friends generating activity at Github I decided to add one of the main missing issues of bashblog: support for tags, or categories, whichever name one prefers.

It turned out to be a bit of work because I had to do some tricks to process comma-separated words, but in the end the result is nice enough. Now, a line accepting tags is displayed at the bottom of each post, and it automatically creates new tag archive files and links them from posts.

This doesn't break compatibility with previous posts, but unfortunately adding categories to old entries needs to be done manually. Here's how. For each post:

  1. Run ./bb.sh edit post.html
  2. You will see a full HTML file. Don't panic! Look for a line which says <!-- text end -->. It is always after the content of the post.
  3. Open a new line above that one, and paste the following template:
    <p>Tags:<a href="tag_tagname.html">tagname</a></p>
  4. Replace tagname (both occurrences) with the desired name for the tag
  5. The part in bold represents one tag. Copy and paste as many as you want between <p> and </p>, separating them with commas.
  6. Make sure that all the tag information is on a single line

When you are done editing the desired posts, run ./bb.sh rebuild and voila! The tag files will be generated.

Don't edit html files manually! Always use bb.sh edit since it keeps the file timestamp, which is necessary for storing the blogpost dates.

Tags: bashblog

Comments? Tweet