Add draft tag, default false, provide filtering on all routes

This commit is contained in:
2023-12-01 20:50:13 -06:00
parent 3d81559a39
commit c1b6498ffe
7 changed files with 427 additions and 39 deletions

View File

@@ -2,7 +2,7 @@
import { getCollection } from "astro:content";
import General from "@layouts/General.astro";
import Summary from "@components/Summary.astro";
const posts = await getCollection("blog");
const posts = (await getCollection("blog")).filter(entry => !entry.data.draft);
posts.sort((a, b) => new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime());
---