static site generator written in shell
Add docs and .gitignore (also Makefile was updated)
Missed a detail on one of the snippets
Added templates in src/



You can also use your local clone with git send-email.


#ssg is a static site generator written in shell.

ssg converts markdown files to html with either lowdown(1) , Markdown.pl or smu(1), copies .html files with <HTML> tag as they are. for the rest of .html files ssg extracts their titles from <H1> tag, prepends _header.html, appends _footer.html, copies from src to dst directory, and generates sitemap.xml, ignores files with names starting in .* or listed in src/.ssgignore.


  • Either lowdown(1) , Markdown.pl, or smu(1) are required if there are *.md files.
  • Just run make install as root from the source repository. The default prefix is /usr/local


  • make sure ssg and either lowdown(1) , Markdown.pl or smu(1) are in your $PATH :

$ PATH="$HOME/bin:$PATH" $ mkdir src dst $ echo '# hello, world!' > src/index.md

$ echo '<html><title></title>' > src/_header.html $ ssg src dst 'test' 'http://www'

./index.md [ssg] 1 files, 1 url

$ find dst dst dst/.files dst/index.html dst/sitemap.xml

$ open dst/index.html

#markdown and html files

html files from src have priority over markdown ones. ssg converts markdown files from src to html in dst and then copies html files from src to dst. in the following example src/a.html wins:

src/a.md -> dst/a.html

src/a.html -> dst/a.html

#incremental updates

on every run ssg saves a list of files in dst/.files and updates only newer files. if no files were modified after that, ssg does nothing.

$ ssg src dst 'Test' 'https://www' [ssg] no files, 1 url $

to force the update delete dst/.files and re-run ssg.

$ rm dst/.files $ ssg src dst 'Test' 'https://www' index.md [ssg] 1 file, 1 url $


this ssg is a derivative of this one which was modified to add support for smu(1)