This Docs Site
This is how I made docs.saxobroko.com.
Stack
- Material for MkDocs for the theme and layout
- GitHub for source control at saxobroko/SaxDocs
- GitHub Actions to build the site on every push to
main - Cloudflare Pages to host the built site at
docs.saxobroko.com
The old setup ran MkDocs on the home PC and proxied it through NPM. That meant the docs only worked when the PC was on. Cloudflare Pages serves the static files from Cloudflare's edge instead, so the site stays up even when home is offline.
Folder structure
The nav bar follows the folder structure under docs/:
docs/
├── Server/ # NAS, network, media
├── PC/ # Client PC notes + app docs (services run on TrueNAS)
├── External/ # Cloudflare, Yubikey, outside services
├── Finance/ # Money stuff
├── Personal/ # Everything else
└── index.md # Landing page
MkDocs picks up pages from folders automatically through the awesome-pages plugin. Top-level tabs (Server, PC, Finance, Personal, External) and sidebar sections are configured in each folder's .pages file and docs/.pages.
Theme and navigation
- Material for MkDocs — default styling with minimal overrides in
overrides/assets/stylesheets/extra.css - Left sidebar — full site tree, always visible (no top tabs)
- Right sidebar — on-page table of contents
- Colours — muted grey accents, header matches page background
- Nav order is controlled by each folder's
.pagesfile
Editing locally
Install dependencies and preview:
Or use Docker:
That runs MkDocs Material on port 8000. Open http://localhost:8000 to preview changes before pushing.
Deploying changes
- Edit markdown files in the
docs/folder - Commit and push to
main - GitHub Actions runs
mkdocs buildand uploads thesite/folder to Cloudflare Pages - The site updates at docs.saxobroko.com within a minute or two
If the live site looks stale, check the Actions tab on GitHub for a failed build.
Full Cloudflare setup steps (one-time) are in Cloudflare Pages.
Adding a new page
- Create a
.mdfile in the right folder - Link to it from related pages so it's discoverable
- Push to
main - The page shows up in the nav automatically
Page history
Every doc page shows when it was created and last updated at the bottom of the page. Dates come from git commit history via the git-revision-date-localized plugin (Melbourne time, relative "time ago" format).
To dig deeper into changes for a specific page:
- On the page — use the history icon at the top of the article (next to "View source") or the View history / Blame links in the page footer. Both open the matching file on GitHub.
- Commit history — View history lists every commit that touched that markdown file.
- Line-by-line blame — Blame shows which commit last changed each line.
Example for this page:
CI checks out the full git history (fetch-depth: 0) so production builds get accurate dates. Local previews need a normal git clone (not a shallow checkout) for the same accuracy.