Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"guides",
"concepts",
"patterns",
"responsible-use",
"reference"
]
}
12 changes: 3 additions & 9 deletions scripts/check-docs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* every site-page markdown file must be reachable from the sidebar nav
* — either listed by slug in an ancestor `meta.json#pages`, covered
* by a `"..."` token in that array, or explicitly allowed as a
* footer-only page. Otherwise the page renders at its URL but never
* appears in the sidebar (easy to miss in review).
* `"..."` token in that array. Otherwise the page renders at its URL
* but never appears in the sidebar (easy to miss in review).
*
* Files intentionally not part of the site (the top-level engineer-facing
* README.md in each root) are skipped via isExcluded().
Expand All @@ -34,16 +34,10 @@ const ROOTS = [
},
];

const SIDEBAR_EXEMPT_PAGES = new Set([
// Linked from the global footer instead of the docs sidebar.
"responsible-use.md",
]);

// Only the top-level README.md is excluded. Nested READMEs (e.g.
// channels/README.md) are site pages and must carry a `url:` frontmatter
// override, validated below.
const isExcluded = (relPath) => relPath === "README.md";
const isSidebarExempt = (relPath) => SIDEBAR_EXEMPT_PAGES.has(relPath);

function walkMarkdown(dir) {
const out = [];
Expand Down Expand Up @@ -176,7 +170,7 @@ for (const root of ROOTS) {
issue: `frontmatter missing \`${field}\``,
});
}
if (nav && !isSidebarExempt(relPath) && !isCoveredByNav(relPath, nav)) {
if (nav && !isCoveredByNav(relPath, nav)) {
failures.push({
root: root.label,
file: relPath,
Expand Down