PyBlosxom plug-ins and helpers

PyBlosxom is a nice lightweight blogging package that works in static mode, doesn't require a database and is fairly easy to maintain.

Plug-ins is a modification of a tag plug-in that used to be available on the web, but I can't find it any more. Anyway, it worked okay in dynamic mode but failed in static mode (where you generate the pages once then serve static HTML pages). This is my modification to work with static mode (which may well have broken it for the dynamic case, as far as I know). is my modification of Jordan Sissel's "pagetitle" single entry page title hack to show a clear readable title on each page (also helpful for search engines). Pagetitle does a good job for individual story pages, but my version also handles category and tag pages.

Helper scripts

These scripts live in $HOME/bin rather than as part of PyBloxsom. It would be better to integrate them into PyBloxsom; I just haven't figured out how to do that yet.

blogedit lets you edit an article source file without changing the date. After you write the file, it changes the date back to whatever it was, so the story doesn't get re-indexed as a new story and annoy all your readers.

blogtouch takes one argument and greps for that argument throughout your blog, resetting the date on anything that matches to be ten years earlier. Then, if you run pyblcmd --static incremental, it will update only the stories that contained that keyword. Use this after editing a story with blogedit. Warning: does not work well with multi-word arguments, even inside quotes; try to find a single pattern without spaces to grep for.

blogtopics generates a table of contents of all blog articles you've ever written, grouped by category, like the Shallow Thoughts archives on my blog. Obviously, edit this to use your own list of categories. If you add new categories, you must add them to the script as well; it is not (yet) smart about noticing what's missing.

blog-tag-index looks for the tags generated by tags-static and makes a static index page of tags.

My PyBlosxom workflow

It did take me a while to work out how to use PyBlosxom effectively. Here's a sketchy description of my workflow:

First, I invented the suffix .blx for blog source files. Otherwise, I can't tell them apart from generated files, which drives me crazy.

I write a new entry, newfile.blx in my blog source directory. When I'm finished writing it, I run an alias, blogupdate, that does this:

cd blogsrcdir;
pyblcmd --static incremental
  && ~/bin/blogtopics
  && mv ../blog/topics.html ../blog/oldtopics.html
  && mv ../blog/newtopics.html ../blog/topics.html;

pyblcmd --static incremental generates new static html files in all places that need to reference the new entry (the entry's own page, my blog home page, the category page, the pages for the month and day, and all relevant tags pages). Then blogtopics re-generates the index of all articles.

If I need to go back and revise an entry, I don't want its date to revert to the present date, so I use my blogedit and blogtouch scripts, then another pyblcmd --static incremental. I label any changes with <p class="update"> or <i class="update"> (shown in a different color) so that it's clear what parts are new and weren't in the original article.

More of my Software
Shallowsky Home
mail me