Python script to generate static site?

Carl Banks imbosol at aerojockey.com
Thu Aug 12 00:08:26 EDT 2004


Fred <fred at acme.com> wrote in message news:<hl5lh0pb3u4m47f2bsatc9vigrv7pc7v07 at 4ax.com>...
> Hi,
> 
> I'm sure there are a bunch of them, but googling just returned
> full-fledged CMS that require a DBMS and generate dynamic pages.
> 
> I'd just like a script that would 
> 1. look in a directory for articles in raw HTML,
> 2. generate a cooked output for each page (ie. add header and footer,
> CSS link in HEAD, etc.),
> 3. regenerate the homepage with "Last modified" bit following each
> article's title,
> 4. ready to be uploaded by FTP to a web server that only handles
> static web pages.
> 
> Considering Python's wealth of libraries, it's most likely only a
> couple hours' work, but since I'm pretty much a Python newbie...


If I may humbly plug my own project, you might try HRL:

http://www.aerojockey.com/software/hrl

In fact, the example on the home page pretty much does exactly what
you ask. It's very versatile for generating static pages, I'd say. 
Maybe too versatile.  If you'd like to be able to use the power of
Python to automate various tasks that come along, this might be what
you want.  If you just want 1, 2, 3, and 4 for all eternity, you might
prefer something less deep.

Also, it supports Unicode, if you need that.


-- 
CARL BANKS



More information about the Python-list mailing list