A dead-simple static site generator created because I wanted templating capabilities (using just the language part of Handlebars) but minimal dependencies. Needs Python 3 and pystache, that's it. For the moment, still pretty rough around the edges, but it works.
After the script's in your $PATH
, run sitestrap.py your-site-config-here.json
.
Some explanation for the provided example site config:
{
"outputDir": "output", // output directory created by the script, won't be overwritten
"copyDirs": ["assets"], // a list of directories to recursively just copy to the output dir
"pages": [
{
"template": "base.mustache", // what template should be rendered?
"context": "pages/home.json", // what context should the template be rendered with?
"outputPath": "index.html" // where should the resulting output go?
},
{
"template": "base.mustache",
"context": "pages/test.json",
"outputPath": "test/index.html"
},
...
]
}
- decent error handling
- ...or any error handling
- more robust handling around current working directory/filepaths
- arg to wipe/overwrite existing output