-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
151 lines (105 loc) · 4.93 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
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:
* [Python Markdown][] for markdown syntax support
* [PyTextile][] for textile syntax support
### 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:
* [Anselm R Garbe][], provided the idea behind this tool (genosite)
* [Luca Postregna][], testing and lots of useful suggestions
* Josie Panzuto, linguistic revision
* [Emanuele Giaquinta][], some tips
### Website
* http://www.minimalblue.com/projects/minimalsite.html
* https://github.com/lavish/minimalsite
[Python Markdown]: http://www.freewisdom.org/projects/python-markdown
[PyTextile]: http://loopcore.com/python-textile/
[Markdown Syntax]: http://daringfireball.net/projects/markdown/syntax
[Textile Syntax]: http://en.wikipedia.org/wiki/Textile_(markup_language)
[Marco Squarcina]: http://www.minimalblue.com/
[Anselm R Garbe]: http://garbe.us/
[Luca Postregna]: http://luca.postregna.name/
[Emanuele Giaquinta]: http://tomaw.net/~exg/