Closed ccozens closed 1 year ago
Thanks to a chat with perplexity
export async function getPaths(): Promise<string[]> { const modules = import.meta.glob('./src/routes/**/*.svelte'); const paths: string[] = []; for (const path in modules) { if (Object.prototype.hasOwnProperty.call(modules, path)) { const modulePath = path.replace('./src/routes', '').replace('.svelte', ''); paths.push(modulePath); } } return paths; }
perplexity's function didn't work but done anyway. docs in learning_blog/creating_nav.md
Thanks to a chat with perplexity