fix section navigation

This commit is contained in:
Matthias Nannt
2023-08-25 09:58:24 +02:00
parent ea3fb45e6e
commit f9bb0dec3c

View File

@@ -14,10 +14,10 @@ export const metadata: Metadata = {
};
export default async function RootLayout({ children }: { children: React.ReactNode }) {
let pages = await glob("**/*.mdx", { cwd: "src/app/docs" });
let pages = await glob("**/*.mdx", { cwd: "app/docs" });
let allSectionsEntries = (await Promise.all(
pages.map(async (filename) => [
"/" + filename.replace(/(^|\/)page\.mdx$/, ""),
"/docs/" + filename.replace(/(^|\/)page\.mdx$/, ""),
(await import(`./${filename}`)).sections,
])
)) as Array<[string, Array<Section>]>;