Benjen is a tiny static blog generator. At its heart is a <100 line Python script, which takes in your templates and blog entries and produces a static site.
From within a blog directory, simply run
benjen and your site's output will be in the directory specified in your config file.
Create a new directory with the following structure:
entries directory contains all your blog entries as Markdown files.
These should, however, contain the following lines at the beginning:
title: Entry Title Goes Here date: YYYY-MM-DD
Date must be in the YYYY-MM-DD form; however, you can optionally append '.X' to the end of the date, to signify which post it is in a given day. Note: This format has changed as of v1.2, from the
#date format. The included 'benjen-upgrade' utility will, when run from within your blog root (or given the path to the root), automatically update your entries from <=1.1 to the new format.
templates directory contains Mako templates. There are three templates in use, with the following parameters passed in.
Noneor filename to the previous page
Noneor filename to the next page
Post objects are dicts containing the following values:
static directory contains any static data to copy into the output path. This is where you'll want to put your CSS. Note: the Markdown output will be using Pygments for code highlighting, so you'll need to add the appropriate CSS rules for it (see also: https://github.com/richleland/pygments-css).
config.yaml file describes a dict with the following values:
If you want to generate your blog automatically on your server when you push updates, you can set up a Git repo and hook to do this.
mkdir barerepo && cd barerepo
git init --bare
git clone barerepo realrepo
Once you've done this, you need to add a file called post-receive to barerepo/hooks/ and make it executable. Sample hook:
unset GIT_DIR cd /path/to/realrepo/blog/directory/ git pull origin master benjen
When you push to the server's repository, it will automatically pull the latest contents into realrepo and then run Benjen. Make sure you change the repository names/paths accordingly.
If you have issues, contact me at firstname.lastname@example.org or use Github's issue tracker.