mirror of
https://github.com/xHyroM/website.git
synced 2024-11-15 03:58:06 +01:00
30 lines
619 B
Text
30 lines
619 B
Text
|
---
|
||
|
import ItemLayout from "@layouts/docs/ItemLayout.astro";
|
||
|
|
||
|
export async function getStaticPaths() {
|
||
|
const docs = await Astro.glob("@docs/**/*.md");
|
||
|
|
||
|
return docs.map((doc) => {
|
||
|
const path = doc.file.split("/docs/")[1];
|
||
|
const [categoryId, docId] = path.split("/");
|
||
|
|
||
|
return {
|
||
|
params: {
|
||
|
category: categoryId,
|
||
|
id: docId.replace(".md", ""),
|
||
|
},
|
||
|
props: {
|
||
|
...doc,
|
||
|
url: `/docs/${categoryId}/${docId.replace(".md", "")}`,
|
||
|
},
|
||
|
};
|
||
|
});
|
||
|
}
|
||
|
|
||
|
const item = Astro.props;
|
||
|
---
|
||
|
|
||
|
<ItemLayout item={item}>
|
||
|
<div set:html={item.compiledContent()} />
|
||
|
</ItemLayout>
|