Skip to main content

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

  1. Create a project scaffold:
jinja2static init mysite
cd mysite
  1. Work locally with live reload:
jinja2static dev
  1. 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 mysite creates a new mysite scaffold with templates, assets, and example data.
  • dev — run a development server that watches source files and rebuilds on change.

    • Usage: jinja2static dev [project_file_path] [-p PORT]
    • Options: -p/--port (default 8000) to choose the server port.
    • Example: jinja2static dev -p 8080 starts the server on port 8080 and serves the generated site while watching for changes.
  • build — render your project to a static output directory for deployment.

    • Usage: jinja2static build [project_file_path]
    • Example: jinja2static build compiles templates, copies assets, and writes the static site to the configured dist folder.

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)

Source distribution for jinja2static 1.0.1
File Size Uploaded
jinja2static-1.0.1.tar.gz 14.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jinja2static 1.0.1
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page