Tiny is a cheeky static site generator in one shell script. It slices content.md into sections, runs them through cmark, and drops the output into template.html.
- Fork or clone this repo.
- Install cmark (Tiny’s only dependency):
brew install cmark
- Edit the copy in
content.md. Each section starts with a##heading. Tiny lowercases and slugifies that heading, so## Herobecomes theherosection. - Wire sections into the template with placeholders in
template.html:{{render:slug}}– render the section as HTML.{{plain:slug}}– render and collapse to plain text (handy for titles/meta).{{lede:slug}}– render and tag the first paragraph withclass="lede".{{raw:slug}}– insert the raw markdown.
- Run Tiny:
With no arguments Tiny overwrites
./build.sh [template [output [content]]]
index.htmlusingtemplate.htmlandcontent.md. Supply a different template, optional output path, and optional content file when you want another page. - Deploy
index.html+styles.css(and any assets) wherever you like—GitHub Pages, Cloudflare Pages, Netlify, etc.
build.sh— the generator (POSIX shell +awk+cmark).content.md— sample story-driven content.template.html— minimal HTML shell showing placeholder usage.blog-template.html— a blog layout driven by the same content.blog.md— markdown sections that feed the blog example.index.html&blog.html— generated examples that keep the templates honest.styles.css— tiny starter styling so the demo looks decent.
- Swap in your own
styles.cssor link to hosted fonts. - Generate additional pages with alternate templates:
./build.sh blog-template.html blog.html blog.md
- Duplicate
content.md/ template pairs and wrap Tiny in a loop if you need entirely different copy. CMARKenv var lets you point to a customcmarkbinary:CMARK=/path/to/cmark ./build.sh.- Preview locally with the Python web server that ships on most systems:
Then open http://localhost:8000.
python3 -m http.server 8000
blog-template.html reads sections from blog.md (blog-title, blog-intro, blog-posts, blog-footnote) to produce blog.html. Update the markdown headings, rerun
./build.sh
./build.sh blog-template.html blog.html blog.mdand the home page will link out to the refreshed blog.
When you just want to ship a handcrafted page with zero build chains, Tiny keeps the tooling out of the way. Fork it, customize the copy, and publish—no frameworks or bundlers required.
—
Built by @nbrempel.