aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/packages/docs/react-router.config.ts
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2026-01-21 20:27:47 +0800
committerGitHub <noreply@github.com>2026-01-21 20:27:47 +0800
commit9ebcd9e9a441c7edcd9d9d55ef65af2799a30a7f (patch)
tree3b7426aa13e66dc29de1a2e06583f5cea9f87596 /packages/docs/react-router.config.ts
parent42b114140b9ddeb1060ac7e51311cc50f5641c2d (diff)
parent85382b427244ebb13497124defacd63f39e2871b (diff)
downloadDropOut-9ebcd9e9a441c7edcd9d9d55ef65af2799a30a7f.tar.gz
DropOut-9ebcd9e9a441c7edcd9d9d55ef65af2799a30a7f.zip
docs: add chinese readme and docs website (#76)
## Summary by Sourcery Add a new documentation site package and a Chinese README to improve project documentation and accessibility. New Features: - Introduce a dedicated @dropout/docs React Router application powered by Fumadocs for hosting the project documentation. Documentation: - Add a Chinese README file providing an overview, installation, build instructions, and contribution guidelines for Chinese-speaking users. - Set up initial docs content, navigation, and metadata within the new docs site, including example pages and search endpoint configuration.
Diffstat (limited to 'packages/docs/react-router.config.ts')
-rw-r--r--packages/docs/react-router.config.ts23
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;