-
Notifications
You must be signed in to change notification settings - Fork 6
/
[slug].astro
48 lines (45 loc) · 1.13 KB
/
[slug].astro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
import { getCollection } from "astro:content";
import BaseHead from "../components/Head/BaseHead.astro";
import MainLayout from "../layouts/MainLayout.astro";
import Header from "../components/Header.astro";
// import "../styles/global.scss";
export async function getStaticPaths() {
const pages = await getCollection("pages");
const filteredPages = pages.filter(
(page) =>
page.id !== "homepage.md" &&
page.id !== "about.md" &&
page.id !== "404.md"
);
return filteredPages.map((page) => {
return {
params: {
slug: page.data!.slug,
},
props: {
page,
},
};
});
}
const { page } = Astro.props;
const { Content } = await page.render();
---
<html lang="en">
<BaseHead />
<MainLayout>
<!-- <Hero data={page.data} /> -->
<Header>
<div class="text-left">
<h1>{page.data.main_title}</h1>
<p>{page.data.main_body}</p>
</div>
</Header>
<section
class="text-left decoration-0 prose container max-w-3xl prose-a:text-openampred prose-headings:my-8 prose-li:list-disc"
>
<Content />
</section>
</MainLayout>
</html>