mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-27 09:19:53 +00:00
- Bump @hanzo/docs-mdx 14.2.11 -> 14.3.1 (surpass orphaned 14.3.0 on npm) - Bump @hanzo/docs-docgen 3.0.8 -> 3.1.1 (surpass orphaned 3.1.0 on npm) - Set changeset access to public for scoped @hanzo/* packages - Update create-app templates to use getPageMarkdownUrl() helper
28 lines
739 B
TypeScript
28 lines
739 B
TypeScript
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: false,
|
|
future: {
|
|
v8_middleware: true,
|
|
},
|
|
async prerender({ getStaticPaths }) {
|
|
const paths: string[] = [];
|
|
const excluded: string[] = [];
|
|
|
|
for (const path of getStaticPaths()) {
|
|
if (!excluded.includes(path)) paths.push(path);
|
|
}
|
|
|
|
for await (const entry of glob('**/*.mdx', { cwd: 'content/docs' })) {
|
|
const slugs = getSlugs(entry);
|
|
paths.push(getUrl(slugs), `/llms.mdx/docs/${[...slugs, 'content.md'].join('/')}`);
|
|
}
|
|
|
|
return paths;
|
|
},
|
|
} satisfies Config;
|