mirror of
https://github.com/withastro/astro.git
synced 2025-01-27 22:19:04 -05:00
12 lines
266 B
JavaScript
12 lines
266 B
JavaScript
|
export async function get() {
|
||
|
const mdxPages = await import.meta.glob('./*.mdx', { eager: true });
|
||
|
|
||
|
return {
|
||
|
body: JSON.stringify({
|
||
|
headingsByPage: Object.fromEntries(
|
||
|
Object.entries(mdxPages ?? {}).map(([k, v]) => [k, v?.getHeadings()])
|
||
|
),
|
||
|
}),
|
||
|
}
|
||
|
}
|