mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-28 07:09:50 +00:00
24 lines
624 B
Plaintext
24 lines
624 B
Plaintext
import type { Config } from '@react-router/dev/config';
|
|
import { glob } from 'node:fs/promises';
|
|
import { createGetUrl, getSlugs } from 'hanzo-docs-core/source';
|
|
|
|
const getUrl = createGetUrl('/docs');
|
|
|
|
export default {
|
|
ssr: true,
|
|
async prerender({ getStaticPaths }) {
|
|
const paths: string[] = [];
|
|
const excluded: string[] = ['/v1/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;
|