diff --git a/src/components/TableOfContents.astro b/src/components/TableOfContents.astro
index 174a1a4..b58b187 100644
--- a/src/components/TableOfContents.astro
+++ b/src/components/TableOfContents.astro
@@ -1,12 +1,17 @@
---
-const { headers } = Astro.props;
+import type { MarkdownHeading } from 'astro';
+
+interface Props {
+ headings: MarkdownHeading[];
+}
+const { headings } = Astro.props;
---
{
- headers.map(({ slug, text }) => {
+ headings.map(({ slug, text }) => {
return (
- -
+
-
#{text}
);
diff --git a/src/layouts/Main.astro b/src/layouts/Main.astro
index e937143..ea74a31 100644
--- a/src/layouts/Main.astro
+++ b/src/layouts/Main.astro
@@ -5,10 +5,13 @@ import Header from "@components/Header.astro";
import Footer from "@components/Footer.astro";
import Sidebar from "@components/Sidebar.astro";
import TableOfContents from "@components/TableOfContents.astro";
+import type { MarkdownHeading } from "astro";
-type Props = CollectionEntry<"handbook">["data"];
+type Props = Pick["data"], "title" | "description"> & {
+ headings: MarkdownHeading[];
+};
-const { title, description, pubDate, lastModified, headers } = Astro.props;
+const { title, description, headings } = Astro.props;
const currentPage = new URL(Astro.request.url).pathname;
---
@@ -29,11 +32,11 @@ const currentPage = new URL(Astro.request.url).pathname;
{
- headers && headers.length > 0 && (
+ headings && headings.length > 0 && (
diff --git a/src/pages/[...slug].astro b/src/pages/[...slug].astro
index bcccb96..bd981f2 100644
--- a/src/pages/[...slug].astro
+++ b/src/pages/[...slug].astro
@@ -14,10 +14,10 @@ type Props = CollectionEntry<'handbook'>;
const isProd = import.meta.env.PROD;
const {render, data} = Astro.props;
const {title, lastModified} = data;
-const { Content } = await render();
+const { Content, headings } = await render();
---
-
+
{title}
{(lastModified ?? (isProd ? null : new Date()))!.toLocaleDateString('en-us', {
diff --git a/src/pages/index.astro b/src/pages/index.astro
index a98301d..fc0d35a 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -1,13 +1,15 @@
---
-import BaseHead from '@components/BaseHead.astro';
-import Header from '@components/Header.astro';
-import { SITE_TITLE, SITE_DESCRIPTION } from '@/consts';
-import { getCollection } from 'astro:content';
+// import BaseHead from '@components/BaseHead.astro';
+// import Header from '@components/Header.astro';
+// import { SITE_TITLE, SITE_DESCRIPTION } from '@/consts';
+// import { getCollection } from 'astro:content';
import Main from '@layouts/Main.astro';
-import FormattedDate from '@components/FormattedDate.astro';
+// import FormattedDate from '@components/FormattedDate.astro';
-const posts = (await getCollection('handbook')).sort(
- (a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf()
-);
+// const posts = (await getCollection('handbook')).sort(
+// (a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf()
+// );
---
-asd
\ No newline at end of file
+
+ Nothing here yet.
+
\ No newline at end of file