Type to search. Arrow keys to move, Enter to open, Esc to close.

All projects
Completed (2026)2026

Static Multisite Generator

Several static websites from one source

A Python and Jinja2 generator that builds several static websites from one source for shared Apache hosting, with image optimization, generated SEO files and an upload-friendly change list.

sample sites
3
page templates
9
generated files per site
4
pytest tests
28
Goal
Keep several small websites with a shared look in one place, let the build do the performance and SEO work, and make FTP uploads send only what changed.
Solution
Shared templates and assets with per-site overrides, rendered per domain with Jinja2. The build post-processes images in the HTML, generates sitemap, robots, llms.txt and .htaccess for every site, keeps unchanged files untouched and writes a hash-based list of files to upload. All front-end libraries and fonts are self-hosted.
Result
A public, documented generator with three fictional sample sites and a test suite. A second build without changes reports nothing to upload, and the link checker runs clean, including external links.
  • Links between the sites work both in the local preview and online
  • Image sizes, loading priority and WebP srcset added automatically at build time
  • Unchanged files keep their modification time, so FTP clients skip them
  • No third-party requests: libraries and fonts served from the site itself
  • HTML autoescaping and strict template variables

How it works

For every domain the build copies the shared and then the site-specific assets, renders the pages, post-processes the images, writes the meta files into a temporary folder and syncs it into the output, touching only changed files. A SHA-256 manifest gives the upload and delete list since the previous build.

Testing

The pytest suite runs against a temporary source tree and covers URL mapping, links between sites, asset versions and overrides, image attributes, the sync and change list, the generated files and the link checker.

Limitations and future work

The generated server configuration targets Apache, and there is no upload script yet: the change list is meant for a manual or lftp-based upload. Possible next steps are an FTPS upload script and consent-based analytics.

Technology nodes

Related research