Eager to get started? This page gives a good introduction for getting started with staticjinja.
Installing staticjinja is simple:
$ pip install staticjinja
This installs two things:
- A command line interface (CLI) to staticjinja for basic needs.
- A python library, accessible via the Developer Interface, to be used with a custom python build script for advanced needs.
Rendering templates with CLI¶
If you’re just looking to render simple data-less templates, you can get up and running with the command line interface:
$ staticjinja build Rendering index.html...
This will recursively search
./templates for templates (any file
whose name does not start with
_) and build them to
To monitor your source directory for changes, and recompile files if
they change, use
$ staticjinja watch Rendering index.html... Watching 'templates' for changes... Press Ctrl+C to stop.
watch each take 3 options:
--srcpath- the directory to look in for templates (defaults to
--outpath- the directory to place rendered files in (defaults to
--static- the directory (or directories) within
None, meaning no files are considered to be static files. You can pass multiple directories separating them by commas: