sr.ht/~novaburst-dev/ssg/tree
https://hg.reactionary.software/
|
1 year ago | |
---|---|---|
COPYING | 1 year ago | |
Makefile | 1 year ago | |
README.md | 1 year ago | |
ssg | 1 year ago |
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 $ bin/ssg6 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
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
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.
$ bin/ssg6 src dst 'Test' 'https://www' [ssg] no files, 1 url $
to force the update delete dst/.files
and re-run ssg.
$ rm dst/.files $ bin/ssg6 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)