Static Rendering
Static rendering made its first appearance in PyBlosxom 1.0. It fills the functionality gap for people who want to use PyBlosxom, but don't have a web-server with CGI installed, don't have CGI access, or can't run PyBlosxom for one of a myriad of other reasons. Static rendering allows these people to run PyBlosxom on their local machine, write blog entries, render their entire site into HTML, and then use ftp or some other file copy method to move the pages up to their static web-site.
PyBlosxom's static rendering allows for incremental building. It can scan your entries, figure out what's changed, and render only the pages that need re-rendering.
Beyond that, it's not particularly sophisticated.
Configuring Static Rendering
These are the instructions for configuring static rendering in PyBlosxom.
-
Install PyBlosxom. When you're copying the pyblosxom.cgi and config.py files, you don't have to put them in a CGI directory--you can put them in any directory you have permissions in. For example, I created a directory /home/joe/pyblosxom/ and put both files in there.
-
Add
static_dir
to your config.py file. This is the directory we will save all the static output. The value ofstatic_dir
should be a string representing the absolute path of the output directory for static rendering. -
Add
static_flavours
to your config.py file. The value ofstatic_flavours
should be a list of strings representing all the flavours that should be rendered. This defaults to [ "html" ]. -
Add
static_monthnames
to your config.py file. The value (either 1 or 0) will determine if you want month names (such as April) in the static pages. -
Add
static_monthnumbers
to your config.py file. The value (either 1 or 0) will determine if you want month numbers (such as 04 for April) in the static pages. -
Set
base_url
in your config.py file to the base url your blog will have. For example, if yourstatic_dir
were set to /home/joe/public_html and the url for that directory were http://www.joe.com/~joe/ , then you probably want yourbase_url
to be http://www.joe.com/~joe/ .
Example 7-1. static rendering configuration
py["static_dir"] = "/home/joe/public_html/static/" py["static_flavours"] = ["html"] py["static_monthnames"] = 0 # i do not want month names py["static_monthnumbers"] = 1 # i do want month numbers
#!/bin/bash ./pyblosxom.cgi --static or ./pyblosxom.cgi --static --incremental
[23:29] | [] | #-permalink-#