From 212d1c68d7b234652e3401bf35a28815ebd32704 Mon Sep 17 00:00:00 2001 From: echus Date: Tue, 23 Jan 2024 19:04:05 +1100 Subject: [PATCH] Remove dynamic "blog" pages --- src/pages/blog/[...slug].astro | 20 ---------------- src/pages/blog/index.astro | 44 ---------------------------------- 2 files changed, 64 deletions(-) delete mode 100644 src/pages/blog/[...slug].astro delete mode 100644 src/pages/blog/index.astro diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro deleted file mode 100644 index ce29bd6..0000000 --- a/src/pages/blog/[...slug].astro +++ /dev/null @@ -1,20 +0,0 @@ ---- -import { type CollectionEntry, getCollection } from "astro:content"; -import BlogPost from "../../layouts/BlogPost.astro"; - -export async function getStaticPaths() { - const posts = await getCollection("blog"); - return posts.map((post) => ({ - params: { slug: post.slug }, - props: post, - })); -} -type Props = CollectionEntry<"blog">; - -const post = Astro.props; -const { Content } = await post.render(); ---- - - - - diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro deleted file mode 100644 index d4442c6..0000000 --- a/src/pages/blog/index.astro +++ /dev/null @@ -1,44 +0,0 @@ ---- -import BaseHead from "../../components/BaseHead.astro"; -import Header from "../../components/Header.astro"; -import Footer from "../../components/Footer.astro"; -import { SITE_TITLE, SITE_DESCRIPTION } from "../../consts"; -import { getCollection } from "astro:content"; -import FormattedDate from "../../components/FormattedDate.astro"; - -const posts = (await getCollection("blog")).sort( - (a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf(), -); ---- - - - - - - - - -
-
-
- -
-
-