Jinja2Static
Jinja2Static is a minimal, developer-friendly toolchain that builds static sites from Jinja2 templates and simple project configurations. It provides three CLI subcommands to scaffold a project, run a development server with live rebuilds, and produce a static output directory for deployment.
Key features
- Scaffolds a small project layout to get started quickly.
- Runs a local development server that watches files and rebuilds on change.
- Builds a static site by rendering Jinja2 templates and copying asset files.
Install
Install from PyPI:
pip install jinja2static
Typical workflow
- Create a project scaffold:
jinja2static init mysite
cd mysite
- Work locally with live reload:
jinja2static dev
- Produce a production-ready static site:
jinja2static build
Project configuration
jinja2static reads project configuration from the provided path or the current working directory. You can pass either a directory or a pyproject.toml file as project_file_path to target a specific project. See the example pyproject.toml in the init scaffold for configurable options (templates directory, asset locations, and output dist directory).
Quick CLI Guide
All subcommands accept an optional project_file_path argument (a directory or a pyproject.toml file). They also accept -v/--verbose to enable more logging.
-
init— initialize a new jinja2static project scaffold.- Usage:
jinja2static init [project_file_path] - Example:
jinja2static init mysitecreates a newmysitescaffold withtemplates,assets, and example data.
- Usage:
-
dev— run a development server that watches source files and rebuilds on change.- Usage:
jinja2static dev [project_file_path] [-p PORT] - Options:
-p/--port(default8000) to choose the server port. - Example:
jinja2static dev -p 8080starts the server on port 8080 and serves the generated site while watching for changes.
- Usage:
-
build— render your project to a static output directory for deployment.- Usage:
jinja2static build [project_file_path] - Example:
jinja2static buildcompiles templates, copies assets, and writes the static site to the configureddistfolder.
- Usage:
Logging & verbosity
Add -v or --verbose to any command to enable more detailed logging useful for debugging builds and the development server.
Contributing
Contributions are welcome. See the source under the src/jinja2static package for implementation details and tests in tests/.
Happy templating! If you want examples tailored to your project layout, open an issue or ask for help.
Metadata
Release files for jinja2static 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jinja2static-1.0.1.tar.gz | 14.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jinja2static-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.6 kB
Release files / jinja2static-1.0.1.tar.gz
| Download URL | jinja2static-1.0.1.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4c8c24000ea6248875eeb941a9d58423859ff675ed4ac58eb2e56653cedd77c
|
|
BLAKE2b-256 checksum How to use checksums |
ea3cc554c37f59f6bebeed75c19dbcb1fee3b1fcf12d805ca5e28e95e0f31cc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / jinja2static-1.0.1-py3-none-any.whl
| Download URL | jinja2static-1.0.1-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc4e603fc7a83f995bad1fec7b3af54e845f9856ddc13c97d971d27be55dd698
|
|
BLAKE2b-256 checksum How to use checksums |
ab68f82a12d943be8bb7f56082695f7c4b8d00142756f96f82b163ce61a1e421
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|