Zero-config static site builder for markdown blogs
Project description
mdwiki
mdwiki is a small static site builder that turns a directory tree of markdown files into a blog-ready HTML site.
It keeps the authoring model simple:
- directories become URL segments
- each markdown file becomes one HTML page
- local images referenced from markdown are copied into the output site
- index pages and tag pages are generated automatically
Install
Use uv:
uv tool install mdwiki
Or install from source:
uv sync
uv run mdwiki_exec ./example-posts ./dist
CLI
Build a site from a markdown source tree:
mdwiki_exec <source_dir> <dist_dir>
Example:
mdwiki_exec ./post ./dist
source_dir usually contains:
- markdown posts under dated folders such as
post/2024/04/03/demo.md - optional local images next to each markdown file
- optional
CNAME
GitHub Pages workflow
The recommended deployment model is:
- Keep markdown source in your repository.
- Build the site in GitHub Actions.
- Upload the generated
dist/directory as a Pages artifact. - Deploy with
actions/deploy-pages.
Example workflow:
name: Build and Deploy Pages
on:
push:
branches: ["master"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/configure-pages@v5
- name: Install mdwiki
run: pip install mdwiki
- name: Build site
run: mdwiki_exec ./post ./dist
- uses: actions/upload-pages-artifact@v3
with:
path: ./dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
steps:
- id: deployment
uses: actions/deploy-pages@v4
Develop with uv
uv sync
uv run mdwiki_exec ./post ./dist
uv build
Publish to PyPI:
uv build
uv publish
Notes
CNAMEis optional.- The bundled default theme is stored under
mdwiki/templates/default. mdwiki_execis the supported public CLI entrypoint.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mdwiki-0.3.2.tar.gz.
File metadata
- Download URL: mdwiki-0.3.2.tar.gz
- Upload date:
- Size: 33.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
130092dc6f93932b546dbca1430c3b434bcee63e9aa4a6f3a0a1d5009ea3b9db
|
|
| MD5 |
8feb5b7ce9249c4b701c70daf47775e2
|
|
| BLAKE2b-256 |
2354aba8724add33f7a3754858e1aeb4505a427f68fc0f1080de1338cb4a9918
|
File details
Details for the file mdwiki-0.3.2-py3-none-any.whl.
File metadata
- Download URL: mdwiki-0.3.2-py3-none-any.whl
- Upload date:
- Size: 35.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb799c05405d08208b5ea92fcd03dd5691f08446798fbb5127332ead3aa765af
|
|
| MD5 |
a9b1d7f21072d16cfa5d605362046625
|
|
| BLAKE2b-256 |
87ecee1a23229266c4ebaa4eb6c1781949cb126928a17014df595b0f81698fb2
|