Skip to content

Commit 0ba680e

Browse files
authored
Merge pull request #149 from USACE-RMC/fix/keep-underscore-docs-unpublished
[Content] Keep underscore-prefixed doc files out of the built site
2 parents 729fee6 + 4101416 commit 0ba680e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎docusaurus.config.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ const require = createRequire(import.meta.url);
1212
const { getInactiveDocLocations } = require('./src/docConfig');
1313
const inactiveDocExcludes = process.env.DOCS_MODE === 'prod' ? getInactiveDocLocations().map((loc) => `${loc}/**`) : [];
1414

15+
// Setting `exclude` replaces Docusaurus's default list, so it is restated here to keep
16+
// underscore-prefixed partials and authoring notes (e.g. `_input-needed.md`) unpublished.
17+
const docusaurusDefaultDocExcludes = ['**/_*.{js,jsx,ts,tsx,md,mdx}', '**/_*/**', '**/*.test.{js,jsx,ts,tsx}', '**/__tests__/**'];
18+
1519
// Normalize the drive letter to uppercase on Windows to prevent webpack
1620
// "modules with names that only differ in casing" warnings.
1721
function normalizeDriveLetter(p) {
@@ -80,7 +84,7 @@ export default {
8084
remarkPlugins: [remarkMath, remarkGfm],
8185
rehypePlugins: [rehypeKatex],
8286
breadcrumbs: true,
83-
exclude: inactiveDocExcludes,
87+
exclude: [...docusaurusDefaultDocExcludes, ...inactiveDocExcludes],
8488
},
8589
// No blog on this site. Without an explicit `false`, preset-classic
8690
// enables the blog plugin on defaults; Docusaurus 3.10+ then emits an

0 commit comments

Comments
 (0)