This directory is the MkDocs custom_dir for datafaker.net. It holds template overrides only — not a copy of the Material theme.
- Built with MkDocs and Material for MkDocs.
- Theme version is pinned in
requirements-docs.txtat the repo root. material/overrides/is the only content that belongs here. Base templates, partials, icons, and bundled JS/CSS come from the pip-installed theme.- Never vendor or copy the full Material theme into
material/. That blocks upgrades and bloats the repo.
mkdocs.yml # site config, theme features, plugins
requirements-docs.txt # pinned Python deps (Material, plugins)
docs/ # Markdown content and static assets
assets/images/ # favicon, hero illustration
stylesheets/extra.css # site-specific CSS
material/overrides/ # Jinja template overrides only
home.html # homepage hero (see docs/index.md front matter)
main.html # announce bar and global template hooks
.github/workflows/
deploy-docs.yml # production: main → www.datafaker.net
Note
Use a Python virtual environment. Modern macOS and many Linux distros block system-wide pip install (PEP 668). A venv keeps docs dependencies isolated from the Java project and matches what CI does in a clean environment.
python3 -m venv .venv-docs
source .venv-docs/bin/activate # Windows: .venv-docs\Scripts\activate
pip install -r requirements-docs.txt
mkdocs serve # http://127.0.0.1:8000
mkdocs build --strict.venv-docs/ is gitignored. Use any venv path you prefer; .venv-docs is just a convention for this repo.
- Production: push to
mainon datafaker-net/datafaker →deploy-docs.yml→gh-pagesbranch → https://www.datafaker.net - Manual:
mkdocs gh-deploy— only when you intend to update thegh-pagesbranch on the repo your git remote points at.
Note
GitHub Pages serves the gh-pages branch, not your source branch (main). The deploy workflow builds from main and pushes the static site to gh-pages.
- Read the Material upgrade guide for the target version.
- Bump the pin in
requirements-docs.txt(e.g.mkdocs-material==9.7.6→ next release). - Run
pip install -r requirements-docs.txt && mkdocs build --strict. - Review
theme.featuresinmkdocs.yml— many behaviors are opt-in since Material 9.x (content.code.copy,content.action.edit,navigation.footer, etc.). Keepnavigation.sectionsdisabled unless you verify that Releases → 3.x / 2.x / 1.x sidebar groups still collapse after re-enabling it (Material 9 treats section items as always expanded). - Visually test: homepage hero, search, edit link, footer navigation, release nav collapse, mobile layout.
- If templates break, fix
material/overrides/anddocs/stylesheets/extra.cssonly. Compare with upstream overrides. Do not re-vendor the theme. - Update this README if the workflow or layout changes.
- Prefer
docs/stylesheets/extra.cssand Material CSS variables over vendored or minified CSS bundles. - Prefer
extra_css/extra_javascriptinmkdocs.ymlover custom JS bundles unless necessary. - Keep template overrides minimal; extend theme templates (
base.html,main.html) rather than copying them.
Current set in mkdocs.yml:
search(Material built-in)macros(version placeholders in docs, driven byextra.datafakerinmkdocs.yml)minifyallscreenshots-og-screenshot
Test each plugin after upgrades; third-party plugins may lag new Material releases.
Note
Allscreenshots / Open Graph: The allscreenshots-og-screenshot plugin injects og:image URLs via og.allscreenshots.com. That service only renders screenshots for verified domains (www.datafaker.net is registered).
When asked to upgrade MkDocs Material: use a Python venv, bump requirements-docs.txt, run mkdocs build --strict, fix material/overrides/ and docs/stylesheets/extra.css only, and never copy theme files into material/.