Cùran's life
A Debian Developer's observations

3rd March 2011 12:48 (GMT)
Extending Chronicle (Updated)

This little blog is created/compiled with Chronicle, coded by Steve Kemp, and one of the cool features is that you can specify a command run before/after your blog gets compiled from the input files. This presents us with one problem and a lot of opportunities.

First to the problem: the singular "a command" (from the manual page) might not be enough. Maybe you want to run more than one command. This can be achieved by creating a directory for the commands you want to run before the compilation and one for the commands you want to run after the chronicle run. [UPDATE]Then just add run-parts /path/to/{before,post}.d to your .chroniclerc for the {pre,post}-build configuration entries.[/UPDATE] (Thanks to Steve for pointing the obvious out to me, don't know why I didn't think of run-parts myself.)

Now to one of the oppurtunities this offers: you can now, for example, create static pages, which share the general visual appearance with your blog entries but don't show up in the tags or archive system. I'm using this to generate an imprint for this blog. The script to generate the imprint looks like:

#!/bin/sh

set -e

OUTPUT_PATH=`grep output ${HOME}/.chroniclerc | cut -d= -f2 | tr -d [:blank:]`

sed -nre'/<\?xml version/,/blosxomFirstDayDiv/ {/blosxomFirstDayDiv/b;p}' \
        ${OUTPUT_PATH}/index.html > ${HOME}/tmp/imprint.html
cat `dirname ${0}`/imprint.data >> ${HOME}/tmp/imprint.html
echo -e "\n" >> ${HOME}/tmp/imprint.html
sed -ne'/imprint_match/,$p' ${OUTPUT_PATH}/index.html >> ${HOME}/tmp/imprint.html
mv ${HOME}/tmp/imprint.html ${OUTPUT_PATH}/imprint.html

There are again some assumptions made here, which you'd need to adopt to your setup:

  • I'm using a modified version of the "Copyrighteous" theme (one of the modifications was detailed yesterday).
  • The script expects the output setting in your .chroniclerc.
  • The content/body of the imprint is stored in a file imprint.data in the same directory as the script which generates the imprint.
  • There is a tmp directory below ${HOME} (this is there to cope with a chroot environment).

Now you have a very powerful system to modify/extend your chronicle-generated blog. I hope you enjoy it as much as I do!

A little P.S.: you might want to use version 4.5, as 4.4 had a nasty encoding bug.

Permalink | chronicle, debian.
3rd May 2011 12:50 (GMT)
Taking over the maintenance of Chronicle

Steve Kemp recently announced his resignation from Debian. That left a few of his packages without a maintainer, one of them was Chronicle. As a Debian Developer using Chronicle, I've adopted this package. The upstream development will still be mostly done by Steve. The packaging is done in a Git repository. The 4.6-1 upload consists of a new upstream version and some housekeeping stuff on the packaging side (like switching to a minimal debian/rules, fixing some Lintian warnings and complying with the latest version of the Debian Policy).

I'd like to take this opportunity and thank Steve for all his work for Debian. Hopefully he'll be back to Debian in the future.

Permalink | chronicle, debian.
15th May 2011 18:42 (GMT)
Chronicle 4.6-2 fixes another UTF-8 encoding issue

Today I was playing with some RDF information, initially triggered by my entry about Josephine. While at it I decided to add some information explicitly to the head tag, including


Obviously I wanted to add those two tags to my templates, so Chronicle adds that to all files. Unfortunately this resulted in an encoding error of the "ä". Some digging in the source of chronicle showed, that HTML::Template-new() was called without ensuring, that the tempalte files were parsed as UTF-8 encoded. The solution was to add a filter.

The just uploaded version 4.6-2 contains the required patch and if you don't use the Debian packages you won't be left out for long, as Steve already applied the fix upstream.

Permalink | chronicle, debian.

Common Blog License: Creative Commons Attribution-ShareAlike 3.0 Unported License | Imprint (Impressum) | Privacy Policy (Datenschutzerklärung) | Compiled with Chronicle v4.6

Archives

Tags
Feed
Support my Debian work!
Validated