folk.zone Wiki

a public knowledge base

Site Tools


indieweb:tiny_ssg

Minimal Static Site Generators

The suckless-adjacent landscape: for when you want more than bashblog but less than Hugo or Eleventy.

ssg

The classic tilde pick, popularized through low-tech and tilde circles: ~150 lines of POSIX sh by Roman Zolotarev. Markdown in, HTML out, plus a sitemap and RSS. Pairs with lowdown for markdown.

git clone https://github.com/roman-zolotarev/ssg
./ssg5 src dst "Site Title" "https://tilde.town/~you"

You write your own _header.html and _footer.html partials and a stylesheet.

saait

Single C binary, ~575 lines, no runtime deps: codemadness.org/saait. Page config files plus a global config.cfg plus a template dir. Generates pages, an index, an Atom feed, a twtxt.txt, sitemap.xml, and urllist.txt out of the box.

git clone git://codemadness.org/saait && cd saait && make
./saait -c config.cfg -o output -t templates pages/*.cfg

Templates are files with {$var} substitution. Want markdown? Pre-convert with smu, lowdown, or pandoc into the pages dir first.

mkws

Shell as the templating language: ~30 lines of sh plus ~400 lines of C. Templates are shell code; you can call any unix tool from inside them.

# a page is literally a shell script that prints html
cat <<EOF
<html><body>
$(lowdown file.md)
<p>built $(date)</p>
</body></html>
EOF

Zero config. You script the generator instead of configuring it.

stagit

Not a blog: suckless.org's tool for turning a git repo into a static site. stagit repo/ emits a browsable HTML mirror (log, files, commits, per-file views). stagit-index builds a repo list page. Runs fine on tildes to serve repos without cgit or GitLab.

lb

Luke Smith's “blog and rss script”: LukeSmithxyz/lb. bashblog-descended: lb new, lb draft, lb finalize, lb delete, auto-RSS and a standalone blogroll. If bashblog feels too interactive, lb is the script-then-publish variant.

DIY

A minimal SSG is ~20 lines of shell you already own:

for f in *.md; do
  pandoc -s --css=style.css --metadata pagetitle="$(basename $f .md)" \
    "$f" -o "${f%.md}.html"
done

Add a hand-written feed and that is a blog.

Choosing

  • Want a blogging loop (post/edit/drafts): bashblog or lb
  • Want total control, few deps, hackable: ssg or mkws
  • Want feeds, twtxt, and sitemap from one binary: saait
  • Want your git repos browsable on the web: stagit
  • Want to understand every line: DIY pandoc

All output is plain HTML. Push to any pubnix with rsync: Publishing on a Pubnix.

See Also

indieweb/tiny_ssg.txt · Last modified: by 127.0.0.1