Skip to content

minimalsite is a fast minimal static website builder. It generates web pages from a file hierarchy with markdown and textile syntax.

License

Notifications You must be signed in to change notification settings

lavish/minimalsite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minimalsite 1.00 11 Sep 2012

MinimalSite

A fast minimal static website builder.

Minimalsite generates web pages from a source file hierarchy. It supports markdown and textile syntax, but plain txt and html can be evenly used. Template files are python modules, providing huge flexibility and keeping the codebase tiny and simple.

Requirements

In order to run minimalsite you need a working Python 2.X or 3.X installation. If you plan to use markdown or textile syntax, one of the following modules is required:

Installation

Extract the archive and install it using the following commands:

$ tar xzvf minimalsite-<version>.tar.gz
$ cd minimalsite-<version>
$ sudo python setup.py install --prefix=/usr/local

Minimalsite can also run without being installed. Just run the tool within its own directory.

Running minimalsite

$ minimalsite.py --help
usage: minimalsite.py [-h] -t TEMPLATE [-V] [-s SRC] [-d DST] [-v] [-m SITEMAP]

Fast minimal static website builder

optional arguments:
  -h, --help            show this help message and exit
  -t TEMPLATE, --template TEMPLATE
                        specify a template file name. Valid templates must
                        terminate with '_template.py'
  -V, --verbose         verbosely display site structure
  -s SRC, --src SRC     source dir, where the textual hierarchy resides
  -d DST, --dst DST     destination dir, where the html pages will be written
  -m SITEMAP, --sitemap SITEMAP
                        full path name for the XML sitemap
  -v, --version         show program's version number and exit

You must start minimalsite providing a valid template file.

Please note that you need to place an index file in each directory you want to parse. Those directories will be ignored otherwise.

Configuration

You can create your own template starting from default_template.py. See comments inside for help. Templates provide a very flexible tool for building your site by adding how many functions and features you want; See example_template.py for a more advanced template.

Features

Minimalsite supports page ordering for menu entries. Add a numerical index before the pathname, for example:

/home/marco/website/30_university.md
/home/marco/website/50_contacts.md

These pages will be translated to:

/var/www/marco/htdocs/university.html
/var/www/marco/htdocs/contacts.html

and "university" will be displayed before "contacts" in the menu. Both files and directories are supported.

Example

The following example explains how to run minimalsite to create a simple site using the default template. Source markdown files are written under /home/lavish/mysite, while the site is generated under /var/www/htdocs/.

$ mkdir /home/lavish/mysite
$ cd /home/lavish/mysite
$ echo "Hi all" > index.md
$ echo "List of my publications" > publications.md
$ echo "You can send me a postcard here..." > contacts.md
$ mkdir software
$ echo "I contributed to the following projects..." > software/index.md
$ echo "A great editor" > software/vim.md
$ echo "A great mail client" > software/mutt.md
$ echo "A great irc client" > software/irssi.md
$ minimalsite.py -s /home/lavish/mysite -d /var/www/htdocs \
                 -t /usr/local/share/minimalsite/templates/default_template.py \
                 -m /var/www/htdocs/sitemap.xml
[*] Processing files from /home/lavish/mysite
[*] Writing html files into /var/www/htdocs
    /var/www/htdocs/contacts.html
    /var/www/htdocs/index.html
    /var/www/htdocs/software
        /var/www/htdocs/software/irssi.html
        /var/www/htdocs/software/index.html
        /var/www/htdocs/software/vim.html
        /var/www/htdocs/software/mutt.html
    /var/www/htdocs/publications.html
[*] Writing sitemap to /var/www/htdocs/sitemap.xml
$ cp /usr/local/share/minimalsite/templates/style.css /var/www/htdocs
$

Misc

Please refear to Markdown Syntax and Textile Syntax documentation before writing your pages.

Author/Credits

Minimalsite is written by Marco Squarcina [email protected]

The following people have contributed to this project:

Website

About

minimalsite is a fast minimal static website builder. It generates web pages from a file hierarchy with markdown and textile syntax.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages