Skip to content
Merged
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
19 changes: 19 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,5 +364,24 @@ export default defineConfig({
}
},
cleanUrls: false,
// `docs/old/` is a scratch archive of superseded planning notes. It is
// gitignored (.gitignore:9) and untracked, so `actions/checkout` never
// materialises it and the PUBLISHED site has never contained those pages —
// this exclusion is therefore not a fix to what ships.
//
// What it does fix is the local-vs-CI divergence. On a developer checkout the
// two files are present, VitePress happily builds them, and every locally
// measured figure silently disagrees with CI: 159 pages locally vs 157 in a
// clean checkout, with the anchor gate's link corpus inflated to match. That
// gap has already cost review time, because a local corpus number cannot be
// compared against the CI one. Excluding the directory makes a local
// `npm run docs:build` produce the same corpus CI does.
//
// Scoped deliberately to `old/**` only. `archive/` sits at the repository
// root, outside VitePress's `docs` srcDir, so it is already unreachable by
// the build and needs no exclusion. No live page links into `old/**`
// (verified against both the markdown source and the emitted HTML), so
// excluding it creates no dead links for the anchor gate to trip over.
srcExclude: ['old/**'],
ignoreDeadLinks: false
})
10 changes: 10 additions & 0 deletions tests/config.import.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ describe('Config Module Loading', () => {
expect(configModule.default.ignoreDeadLinks).toBe(false)
})

// Asserted against the RESOLVED export, not the file text. A
// `configContent.toContain('srcExclude')` check would also be satisfied by
// the explanatory comment sitting directly above the option, so it could not
// tell a live setting apart from a description of one.
it('should exclude docs/old from the build via srcExclude', async () => {
const configModule = await import('../docs/.vitepress/config.ts')
expect(configModule.default).toHaveProperty('srcExclude')
expect(configModule.default.srcExclude).toEqual(['old/**'])
})

it('should have dark mode enabled', async () => {
const configModule = await import('../docs/.vitepress/config.ts')
expect(configModule.default.themeConfig).toHaveProperty('darkModeSwitch')
Expand Down