From 41014160733cf79ae9aa8a93f7850f8c03aee351 Mon Sep 17 00:00:00 2001 From: Adam Gohs Date: Thu, 15 Oct 2026 15:22:43 -0400 Subject: [PATCH] Keep underscore-prefixed doc files out of the built site Setting the docs plugin's exclude option replaces Docusaurus's default exclude list, so underscore-prefixed partials and authoring notes such as _input-needed.md were being built as public pages. Restore the default patterns ahead of the inactive-document excludes. --- docusaurus.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index ded013ba5..a6bd9558a 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -12,6 +12,10 @@ const require = createRequire(import.meta.url); const { getInactiveDocLocations } = require('./src/docConfig'); const inactiveDocExcludes = process.env.DOCS_MODE === 'prod' ? getInactiveDocLocations().map((loc) => `${loc}/**`) : []; +// Setting `exclude` replaces Docusaurus's default list, so it is restated here to keep +// underscore-prefixed partials and authoring notes (e.g. `_input-needed.md`) unpublished. +const docusaurusDefaultDocExcludes = ['**/_*.{js,jsx,ts,tsx,md,mdx}', '**/_*/**', '**/*.test.{js,jsx,ts,tsx}', '**/__tests__/**']; + // Normalize the drive letter to uppercase on Windows to prevent webpack // "modules with names that only differ in casing" warnings. function normalizeDriveLetter(p) { @@ -80,7 +84,7 @@ export default { remarkPlugins: [remarkMath, remarkGfm], rehypePlugins: [rehypeKatex], breadcrumbs: true, - exclude: inactiveDocExcludes, + exclude: [...docusaurusDefaultDocExcludes, ...inactiveDocExcludes], }, // No blog on this site. Without an explicit `false`, preset-classic // enables the blog plugin on defaults; Docusaurus 3.10+ then emits an