No project description provided
Project description
Jinja2 SSG
A very simple static site generator.
- The filesystem structure in
--src
is copied into--dest
. - Files and folders starting with
_
are skipped. - By default only html, txt, js files are used and the rest of them are skipped.
- YAML files can be used to provide data inside templates.
python3 -m pip install jinja2ssg
python3 -m jinja2ssg --src src --dest publish build
Example
site/src/
├── _base.html
├── _social_links.yaml
├── donate
│ └── index.html
├── _footer.html
├── index.html
└── _nav.html
Results in a DEST structure like:
site/www/
├── index.html
└── donate
└── index.html
Common patterns
- Run with
inotify
to rebuild on source file changes.inotifywait --recursive --monitor --format "%e %w%f" \ --event modify,move,create,delete ./src \ | while read changed; do echo $changed (python3 -m jinja2ssg build) done
- Put social links inside
_social.yaml
files and access as{{ yaml._social.facebook }}
- Access all build paths using
{{ build_paths }}
. Useful while writing service worker code to cache the site as a PWA. - Access
{{ relative_path }}
to know the path of the current file being rendered.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jinja2ssg-0.2.0.tar.gz
(3.6 kB
view hashes)
Built Distribution
Close
Hashes for jinja2ssg-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cf6a760f490c5afe6aa416a7b27eb196796e030ca87038e73a21093773a26d3 |
|
MD5 | 8171aee9517448c3a34bd89b493aab3d |
|
BLAKE2b-256 | 843257a7b7f668d8e261131829f75077695e726708138635ab7dbc1898750c1b |