Will's blog

purpose: Will Kahn-Greene's blog of Python, Linux, random content, PyBlosxom, Miro, and other projects mixed in there ad hoc, half-baked, and with a twist of lemon

Sun, 13 Nov 2005

PyBlosxom status: 11/13/2005

I re-re-wrote the flavour template code for the upcoming PyBlosxom 1.3 release. It works like this now:

  1. Pulls flavour templates from taste.flav that comes with PyBlosxom if that flavour exists.
  2. In either $datadir OR $flavourdir:
    1. If there is a directory named taste.flav, then it will take the template files from there and override the ones it got from step 1.
    2. OTHERWISE, it will look for files ending in .taste and override the ones it got from step 1.
  3. If the request is for a non-root path, it'll look in all the directories between $datadir (OR $flavourdir) and $datadir/path_info/ (OR $flavourdir/path_info/) looking for taste.flav directories OR files ending in .taste.

This allows you to put all your flavour files in a flavour directory that you specify in your config.py file.

This allows you to put all the flavour files in a taste.flav directory (for example, html.flav, happygoodness.flav, rss20.flav, atom10.flav, ...).

This allows you to override individual template files from the default flavours. For example, if you wanted to add RSS enclosures, you can put a story.rss file in your $datadir/, $flavourdir/, $datadir/rss.flav/, or $flavourdir/rss.flav/ directory (depending on how you set things up) with the enclosure markup in it and PyBlosxom will pull the default rss templates and use your story.rss template.

This allows you to override individual template files depending on what category the user is looking at.

This makes it easier to package and distribute flavour packs because they can all sit in a single directory all by themselves.

There should be no backwards-compatibility issues with the new code between PyBlosxom 1.2 and 1.3.

NOTE: The code needs to bake a bit. I tested a lot of combinations of things, but I'm still finding occasional issues. This blog is using the latest code, so if you find any issues, write a comment below (assuming that's not broken) and I'll fix the issue.

I have one more big thing on my list of things to do for PyBlosxom 1.3. After that I'll probably release an RC1. Depending on school work, that could happen in the next few weeks. If you want to see the code now, get it from CVS (instructions for CVS access here).

Please keep comments appropriate. I reserve the right to remove anonymous comments, flames, spammy, inappropriate, and other comments that I deem to be worth removing.

Note: New comments get placed in a "draft" status and will NOT show up on the site until I explicitly approve it. Usually that happens within 24 hours, but sometimes I go away and it takes a day or two.

Note 2: There is now a preview button for those of you who want to see a preview! However, it doesn't quite work the way you'd think it should work. I'll look into adjusting it some day.

Note 3: If you can't for some reason post a comment, send me an email: willg at bluesock dot org.

Your name:


Your e-mail address (this doesn't get displayed to anyone--I use it to contact you if there are issues):


URL of your website (optional):


Comment:


Yes, I am a human!

pyblosxom::2.0 dev

All contents Copyright 1996 to 2008 Will Guaraldi.
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.