Preface
What is mettu?¶
mettu is a static site generator designed for personal sites, blogs, and documentation portals that want simple Markdown authoring without giving up modern frontend tooling.
Instead of reimplementing CSS bundlers in Python or writing a Markdown/template ecosystem from scratch in Node, mettu splits the job cleanly:
- Python (
src/main.py) handles content: parsing YAML frontmatter, rendering Markdown with Pygments syntax highlighting, evaluating Jinja2 templates, and generatingsitemap.xml,feed.xml, tag pages, andsearch-index.json. - Vite (
vite.config.mjs) handles assets: preprocessing responsive images with Sharp, compiling Tailwind CSS v4 + DaisyUI v5, bundling client scripts, and serving hot-reloaded previews during development.
How a build flows¶
When you run mettu build:
vite.config.mjsensures a local Python.venvexists and installsmettu's Python dependencies ifrequirements.txtchanged.src/image-preprocess.mjsscansassets/images/, generates responsive formats (WebP/AVIF/JPEG), and writes.cache/image-manifest.json(optionally syncing to an S3-compatible bucket).src/main.pygeneratesgenerated.daisyui.css,generated.fonts.css, andsyntax.css, parsescontent/**/*.md(using.cache/page-cache.jsonto skip unchanged files), and renders HTML into the working directory.- Vite bundles all HTML entrypoints, CSS, JS, and processed images into
dist/, copies XML feeds/sitemaps andsearch-index.json, and cleans temporary HTML out of your root directory.
Tip
Because mettu ships as an npm package (@andy34g7/mettu), your site repository only needs config.yaml, content/, assets/, public/, and any templates you choose to override.