diff options
| author | 2026-01-29 15:39:55 +0800 | |
|---|---|---|
| committer | 2026-01-29 15:39:55 +0800 | |
| commit | 2181e4a26c1581b4402312a7974f00cefb125752 (patch) | |
| tree | 8d38ce794f4b31ad1de9e61738eba125acc39ddd /packages/docs/react-router.config.ts | |
| parent | 410c949b87424b4ac0df5e3f38930781c6eda147 (diff) | |
| parent | 5d630a24bed07dca20b6ddf55ffe4be36399ad0f (diff) | |
| download | DropOut-2181e4a26c1581b4402312a7974f00cefb125752.tar.gz DropOut-2181e4a26c1581b4402312a7974f00cefb125752.zip | |
Refactor Java runtime to async modular system with Adoptium support (#82)
Diffstat (limited to 'packages/docs/react-router.config.ts')
| -rw-r--r-- | packages/docs/react-router.config.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/docs/react-router.config.ts b/packages/docs/react-router.config.ts new file mode 100644 index 0000000..cfcfbe4 --- /dev/null +++ b/packages/docs/react-router.config.ts @@ -0,0 +1,23 @@ +import type { Config } from '@react-router/dev/config'; +import { glob } from 'node:fs/promises'; +import { createGetUrl, getSlugs } from 'fumadocs-core/source'; + +const getUrl = createGetUrl('/docs'); + +export default { + ssr: true, + async prerender({ getStaticPaths }) { + const paths: string[] = []; + const excluded: string[] = ['/api/search']; + + for (const path of getStaticPaths()) { + if (!excluded.includes(path)) paths.push(path); + } + + for await (const entry of glob('**/*.mdx', { cwd: 'content/docs' })) { + paths.push(getUrl(getSlugs(entry))); + } + + return paths; + }, +} satisfies Config; |