Quick start


For in depth documentation please see user manual.


Pagegen is packaged as a .deb or a Python package. Both installations allow for easy upgrades.

.deb installation

Download, dpkg and Bob's your uncle.

$ wget http://pagegen.phnd.net/include/download/pagegen_2.1.1_all.deb
$ dpkg -i pagegen_2.1.1_all.deb

Python package

We will setup a virtual environment and install Pagegen using Python. Virtual environment allows a project to run it's own Python environment.

Create virtual environment, activate it and install Pagegen. Because we activate the virtual environment using the source command, then we use Python's package management system PIP to install Pagegen in the virtual environment.

$ mkdir pagegen_virtualenv
$ virtualenv pagegen_virtualenv
$ source pagegen_virtualenv/bin/activate
$ pip install pagegen

Create example site

First initialise a new Pagegen site directory.

$ mkdir my_site
$ cd my_site
$ pagegen --init


Python does not seem to detect locale on Mac OS X, returning a ValueError, 'unknown locale'. Try running pagegen command as LC_ALL=en_US.UTF-8 pagegen ... To make permanent add export LC_ALL=en_US.UTF-8 to ~/.profile

The last command sets up the current directory with a basic pagegen framework of files and folders.

We are going to create our site according to this outline.

  • Home page
  • Fruit
    • Pear
    • Apple
  • Contact us

Ensure the commands below are run from my_site directory. They will first delete the example site content which comes with Pagegen and create the site as outlined above.

$ rm -Rf content/*
$ echo "This is the home page" > content/index.html
$ mkdir content/Fruit
$ echo "All directories must have a file named index" > content/Fruit/index.html
$ echo "We want Pear first in menu" > content/Fruit/001_Pear.html
$ echo "We want Apple last" > content/Fruit/002_Apple.html
$ echo "Who ya gonna call" > content/Contact\ us.html

Generate example site

We are now ready to generate the site. This will create the finished site in the my_site/site directory.

$ pagegen --generate

The my_site/site directory now contains a freshly generated site ready for upload to a web server.

The generated site maps to the above outline as follows.

Name Site
Home page index.html
Fruit fruit/index.html
Pear fruit/pear.html
Apple fruit/apple.html
Contact us contact-us.html

Customize layout

Pagegen adds layout and navigation elements to each page when they are processed. To change the site look and feel change my_site/page.template and add required elements to my_site/include directory, e.g. css, images, javascript etc..