HOWTO – Build and Preview Public and Academy Docs¶
Purpose: Show how to generate the audience-specific doc trees and static sites, and preview them locally.
Difficulty: Intermediate
Prerequisites:
- HybridOps repo cloned.
- Python and virtualenv (or equivalent) available.
- Able to run make from the repo root.
Demo (optional)¶
If you record a short walkthrough later, link it here.
- Demo: (TBD)
- Source: Docs tooling
Context¶
The documentation system produces two audience-specific sites from a single docs/ tree:
- Public docs – for GitHub visitors, assessors, and hiring managers.
- Academy docs – for HybridOps Academy learners.
The build pipeline:
- Scans
docs/and generates ADR, HOWTO, runbook, CI and showcase indexes. -
Applies the access/stub model to build:
-
deployment/build/docs/public -
deployment/build/docs/academy -
Generates MkDocs configs and builds static sites:
-
deployment/build/site/docs-public deployment/build/site/docs-academy
This HOWTO walks through those steps, how to preview the result, and how to build the academy variant for a separate paid-docs host.
Steps¶
1. Prepare the environment¶
From the repo root:
cd <your workspace root> # the directory that contains hybridops-docs/
cd hybridops-docs
make docs.venv.refresh
Confirm mkdocs is available:
.local/venv/bin/mkdocs --version
Expected: mkdocs reports a version and exits with status 0 from .local/venv/bin/mkdocs.
This repo intentionally builds with a frozen MkDocs 1.x / Material 9.x toolchain from control/requirements.lock.txt.
2. Generate indexes and audience-specific doc trees¶
Run the docs preparation target:
make docs.prepare
What this does:
- Runs index generators under
control/tools/indexing/. -
Applies the access/stub model with:
-
control/tools/mkdoc/build_generator/build_mkdocs_trees.py -
Produces the audience-specific trees:
-
deployment/build/docs/public -
deployment/build/docs/academy -
Generates MkDocs configs via:
-
control/tools/mkdoc/build_generator/build_mkdocs_configs.py
Expected results:
- No errors in the terminal.
- The paths above exist and contain Markdown trees filtered by audience.
-
New configs appear under
control/tools/mkdoc/and use repo-relative paths: -
mkdocs.public.yml mkdocs.academy.yml
3. Build the public and academy sites¶
From the repo root:
make docs.build
This runs:
.local/venv/bin/mkdocs build -f control/tools/mkdoc/mkdocs.public.yml.local/venv/bin/mkdocs build -f control/tools/mkdoc/mkdocs.academy.yml
Expected results:
deployment/build/site/docs-publiccontainsindex.htmland the docs structure.deployment/build/site/docs-academycontainsindex.htmland the docs structure.- Both site directories contain
_worker.js, so the Pages Function proxy is available on public and academy hosts. - MkDocs reports “Documentation built” for both configs.
If the academy build is being published to a separate host, set the academy canonical URL before the build:
HYBRIDOPS_DOCS_ACADEMY_SITE_URL='https://learn-docs.hybridops.tech' make docs.build
That keeps the academy sitemap and canonical URLs aligned to the paid-docs host instead of the legacy /academy path on the public site.
4. Serve the built sites locally¶
For a simple static preview, use Python’s HTTP server.
Public docs:
python -m http.server --directory deployment/build/site/docs-public 8000
# Browse to http://127.0.0.1:8000
Academy docs (second terminal):
python -m http.server --directory deployment/build/site/docs-academy 8001
# Browse to http://127.0.0.1:8001
Expected results:
- Public site at
http://127.0.0.1:8000shows public docs with stubs where appropriate. - Academy site at
http://127.0.0.1:8001shows full academy content.
5. Live reload with MkDocs (optional)¶
For development, use mkdocs serve with the generated configs:
.local/venv/bin/mkdocs serve -f control/tools/mkdoc/mkdocs.public.yml -a 127.0.0.1:8000
.local/venv/bin/mkdocs serve -f control/tools/mkdoc/mkdocs.academy.yml -a 127.0.0.1:8001
Expected results:
- Local servers with automatic rebuild when you edit
docs/. - Navigation and audience behaviour matching the static builds.
Validation¶
make docs.prepareandmake docs.buildcomplete without errors.deployment/build/docs/publicanddeployment/build/docs/academyexist and contain filtered trees.deployment/build/site/docs-public/index.htmlanddeployment/build/site/docs-academy/index.htmlexist.- Public site:
- Shows full content for
access: public. - Shows stubs for
access: academywhere configured. - Academy site:
- Shows full content for both public and academy documents.
- If
HYBRIDOPS_DOCS_ACADEMY_SITE_URLis set: control/tools/mkdoc/mkdocs.academy.ymluses the paid-docs host assite_url.deployment/build/site/docs-academy/sitemap.xmlpoints at the paid-docs host.
For formal evidence, capture:
- A short screen recording of building and browsing both sites.
- Screenshots of ADR/runbook/HOWTO indices and at least one stubbed academy page.
Troubleshooting¶
- Issue:
mkdocsnot found.
Cause: The repo-local docs virtualenv has not been prepared.
Fix: Refresh the docs virtualenv:
make docs.venv.refresh
-
Issue: Build fails with link warnings only.
Cause: Missing HOWTO/runbook/diagram referenced by existing docs.
Fix: Create the referenced file or update/remove the link. Warnings do not block the build unlessstrict: trueis set. -
Issue:
'bool' object has no attribute 'split'during MkDocs build.
Cause:template:front-matter field set totrue/falseinstead of a template name.
Fix: Removetemplate:or rename it tois_template_doc:and settrue/false. -
Issue: Public and academy sites look identical.
Cause: No documents marked withaccess: academyor stubs not enabled.
Fix: Review ADR-0021/ADR-0022 and front matter of selected documents.
References¶
- ADR-0021 – Documentation Access and Gating Model
- ADR-0022 – Documentation, Public Site, and Academy Strategy
- Docs tooling overview:
../guides/docs-tooling-overview.md(if present) - Evidence Map
Maintainer: HybridOps License: MIT-0 for code, CC-BY-4.0 for documentation unless otherwise stated.