sw
sw stands for Suckless Web-framework. As the name suggests It aims to be a minimal and sane web framework.
Features
- Markdown support.
- Only depends on some standard commands: 'echo', 'grep', 'ls', 'sed'...
- Easy configuration.
- Generating a web site is as easy as creating folders for sections and markdown files for contents.
- Use your favorite cvs and editor to maintain and edit the site.
- Minimalism (under 100 LOC).
Get it!
$ hg clone http://nibble.develsec.org/hg/sw
sw configuration
Configuration is done by editing sw.conf (I think the names of the variables and the comments are self-explanatory enough):
TITLE="foo.org" # Site title
SUBTITLE="" # Site subtitle
BL="index.md images" # Black list
STYLE="style.css" # Stylesheet name
MDHANDLER="/usr/local/bin/md2html.awk" # md handler
sw installation
Just run:
sudo make install
If you want to override the default prefix (/usr/local):
sudo make install PREFIX=/path/to/prefix
Example
We want to create a web site with a section called "papers" with two papers inside called "paper1" and "paper2" respectively. In this case, we should create a structure like this:
/path/to/working/directory
+- sw.conf
+- style.css
+- site/
+- index.md
+- papers/
+- index.md
+- paper1.md
+- paper2.md
And run:
sw site
The static site will be created under "site.static". The whole process can be automatized if you create a Makefile like this in your working directory:
$ cat Makefile
all:
sw site
rsync -avz site.static/ foo.org:/path/to/wwwroot/
clean:
rm -rf site.static
Credits
Thanks to Uriel (cat-v.org) for creating werc which inspired sw and which stylesheet was used by default.
Thanks to Jesus Galan (yiyus) for coding md2html.awk.
Thanks to pancake for coding sw.gen.
Thanks to Andrew Antle for the new stylesheet.