THE GITHTML FIELD GUIDE
Distinguish MkDocs drafts, exclusions, and unlisted pages
Use MkDocs draft, exclusion, and navigation settings according to their distinct purposes, then inspect a production build to verify the result. A page hidden from navigation may still be generated and reachable. Do not place confidential information in a documentation tree merely because a menu or development-only setting appears to hide it.
Define the desired publication state
For each exceptional page, decide whether it should be built and listed, built but unlisted, available only during drafting, or excluded from output. These are different editorial states. Write the decision down before choosing a configuration key. Check the installed MkDocs version because the available controls and their behavior have evolved. Avoid copying a configuration fragment from an older project without reading the current version's documentation. If the requirement is confidentiality, use the organization's approved access-controlled system instead of relying on static-site visibility conventions. A documentation build setting is not a general data-protection boundary.
Test one harmless file for each state
Create non-sensitive sample pages with distinctive titles in a test copy of the documentation. Apply the intended rules and compare local serving with a production build. The sample configuration illustrates exclusion and intentional navigation omission; adapt it only after confirming support in your installed version. Inspect inherited configuration and pattern scope so a rule does not unintentionally match other files. Avoid using a real private document as the first experiment. If an excluded file was already published, a new build configuration alone does not prove that every earlier hosted or cached copy has disappeared.
exclude_docs: |
/internal-sample.md
not_in_nav: |
/supporting-reference.mdInspect generated artifacts and incoming links
After building, check whether each test page exists in the output and whether navigation or direct links can reach it. Look for broken references from included pages to excluded content. Review search indexes and other generated collections when the project's plugins produce them; omission from a sidebar says nothing about those surfaces. Record the intended state and evidence for important draft material. Before publication, remove test fixtures or keep them only in a clearly designated validation area. A reliable process makes publication decisions explicit and testable rather than depending on a maintainer remembering which files happen to be visible in a preview session. Include newly added files in the publication review, not only modified pages. An innocent asset or data file under the content directory can enter output even when nobody intended it as a navigable document.
- Classify each page by intended build and navigation state before selecting a rule.
- Verify the installed version's documented behavior and inherited configuration.
- Use harmless fixtures to compare serving and production output.
- Inspect files, links, and generated collections; do not equate hidden navigation with private access.
Sources and further reading
AI-assisted writing with source-linked guidance and illustrative examples. Read our editorial approach or report a correction.