A multi-site, multi-language static site generator built with Python + Jinja2.
Write content in Markdown with YAML frontmatter, configure a site in YAML, and
pagesmith generates fully static HTML pages for every configured language.
The generator is an installable Python package. Sites are self-contained directories that can live anywhere on disk — they are never bundled with the tool itself.
uv is the recommended installer. From a checkout:
make install # uv venv .venv + uv pip install -e '.[watch,serve]'
source .venv/bin/activate
pagesmith --versionmake install creates the project virtual environment (.venv) with uv and
installs pagesmith editable with the watch and serve extras. Manually, the
same steps are:
uv venv .venv
uv pip install -e '.[watch,serve]'
source .venv/bin/activateTo use the pagesmith command without a checkout, uv tool install works too:
uv tool install 'pagesmith[watch,serve]'On distributions with an externally-managed Python (Debian/Ubuntu, recent
Homebrew), pip refuses to install into the system Python. Create a virtualenv
first:
python3 -m venv .venv
. .venv/bin/activate
pip install -e '.[watch,serve]'Runtime dependencies (Jinja2, PyYAML, Markdown) are declared in
pyproject.toml. Extras add watchdog (watch) and livereload (serve).
pagesmith add-site mysite --dir . --title "My Site" # scaffold a site
pagesmith build --site-dir mysite # build it
pagesmith serve --site-dir mysite # http://0.0.0.0:8000
pagesmith watch --site-dir mysite # rebuild on change
pagesmith --helpmake targets wrap the CLI in this repository:
make test # Run unit tests (stdlib unittest)
make verify # test + a scaffold/build smoke check
make docs # Build the user docs (mkdocs --strict)
make docs-serve # Serve the docs with live reloadThe site directory is resolved in this order:
--site-dir PATH— a directory containingconfig/site.yamlPAGESMITH_SITE_DIRenvironment variable--site NAME—./sites/NAME(or./NAME) relative to the current directory (handy when a site repository keeps multiple sites undersites/)
The output directory is resolved in this order:
--output DIR(orPAGESMITH_OUTPUT)build.output_dirfromconfig/site.yaml(absolute, or relative to the site root)./build/<site-name>at the current working directory
Output may be anywhere except the site directory or one of its source subdirectories (the generator refuses those to protect your source tree).
build, serve, watch, add-site, add-page, remove-page, list-pages,
add-language, list-languages, translate, sync-translations, new-post,
list-posts, draft, publish, list-drafts, list-taxonomies, check,
validate-yaml, links, export, status.
pagesmith add-page portfolio --site-dir mysite
pagesmith new-post hello-world --title "Hello World" --site-dir mysite
pagesmith check --site-dir mysite
pagesmith export --site-dir mysite -o backup.zippyproject.toml # Packaging metadata, dependencies, entry point
src/pagesmith/ # The installable package
cli.py # `pagesmith` command dispatch
builder.py # SiteBuilder orchestrator
manager.py # Site management (pages, posts, drafts, export)
paths.py # Site/output path resolution
server.py watcher.py # Dev server and file watcher
templates/ # Shared Jinja2 templates (base + partials)
plugins/ # Python plugins (mermaid, code linking, emoji)
shortcodes/ # Built-in shortcode implementations
scaffold/ # Files copied into new sites by `add-site`
tests/ # Unit tests (stdlib unittest)
sites/ # Example sites (default, hero-example)
docs/ # User documentation (MkDocs)
Makefile # Thin wrappers around the pagesmith CLI
- Multi-language output with per-language fallback and a language switcher
- Section pages & child pages with automatic breadcrumbs and child listings
- Blog posts & taxonomies — tags/categories generate index and term pages
- Shortcodes —
youtube,figure,highlight,gist,emoji,data,download,child_link,children(seesrc/pagesmith/shortcodes/) - Emoji — markdown shorthand (
:rocket:) or the{% emoji %}shortcode - Mermaid diagrams — rendered to SVG at build time (requires
@mermaid-js/mermaid-clionPATH) - Code linking — auto-links C/C++ standard library symbols to cppreference.com
- RSS/Atom feeds & sitemap — generated automatically from posts
User documentation lives in docs/ and is built with
MkDocs: overview, installation, quick start, CLI
reference, site structure, configuration, content, translations, templates,
shortcodes, features, deployment, and troubleshooting.
Build or preview it locally:
make install # uv venv .venv + editable install (watch, serve)
uv pip install '.[docs]' # docs extra (mkdocs)
mkdocs serve # preview at http://127.0.0.1:8000
mkdocs build # write the site to ./site/make install # uv venv .venv + editable install (watch, serve)
make test # Run unit tests (stdlib unittest)
make verify # test + scaffold/build smoke checkThe test suite is self-contained: integration tests scaffold throwaway sites in temporary directories, so no sample site ships with the package.