Files
supabase/apps/docs/lib/mdx/handleRefStaticPaths.tsx
T

20 lines
468 B
TypeScript

import { ICommonSection } from '~/components/reference/Reference.types'
async function handleRefGetStaticPaths(sections: ICommonSection[], libraryPath: string) {
return {
paths: sections.map((section) => {
return {
params: {
slug: libraryPath
.split('/')
.filter((dir) => !!dir)
.concat(section.slug),
},
}
}),
fallback: 'blocking',
}
}
export default handleRefGetStaticPaths