From fce732ee417b954601dd60250b4c264df9661f3d Mon Sep 17 00:00:00 2001 From: aria Date: Wed, 21 May 2025 02:03:33 +1000 Subject: [PATCH 1/2] Add the ability to support hidden draft posts --- src/blog/post-1.mdx | 1 + src/blog/post-2.mdx | 1 + src/blog/post-3.mdx | 1 + src/content.config.ts | 1 + src/pages/blog.astro | 8 +++++++- 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/blog/post-1.mdx b/src/blog/post-1.mdx index 9e2b94c..5de6960 100644 --- a/src/blog/post-1.mdx +++ b/src/blog/post-1.mdx @@ -4,6 +4,7 @@ pubDate: 2024-12-17T00:49:00.000+11 description: 'This is the first post of my new website. featuring information on why I chose Astro to rewrite it and some extra fun information along the way!' author: 'Aria' tags: ["blogging", "learning in public", "development"] +draft: false --- import { Picture, getImage } from "astro:assets"; import FriendLink from "../components/FriendLink.astro"; diff --git a/src/blog/post-2.mdx b/src/blog/post-2.mdx index 11b8fa9..7f18325 100644 --- a/src/blog/post-2.mdx +++ b/src/blog/post-2.mdx @@ -4,6 +4,7 @@ pubDate: 2025-03-10T14:35:00.000+11 description: 'HRT appointment is getting closer and I have some thoughts and want to go over the story' author: 'Aria' tags: ["personal", "HRT", "🏳️‍⚧️"] +draft: false --- ## The story so far diff --git a/src/blog/post-3.mdx b/src/blog/post-3.mdx index 541fd67..b8bb976 100644 --- a/src/blog/post-3.mdx +++ b/src/blog/post-3.mdx @@ -4,6 +4,7 @@ pubDate: 2025-05-13T01:47:00.000+11 description: 'Time to get my keys and addresses all sorted' author: 'Aria' tags: ["learning in public", "security", "GPG"] +draft: false --- import { Picture, getImage } from "astro:assets"; import ssh_autofill from "../img/blog/Screenshot_20250513_004022.png"; diff --git a/src/content.config.ts b/src/content.config.ts index 5a43f28..dd9721f 100644 --- a/src/content.config.ts +++ b/src/content.config.ts @@ -13,6 +13,7 @@ const blog = defineCollection({ description: z.string(), author: z.string(), tags: z.array(z.string()), + draft: z.boolean(), }), }); diff --git a/src/pages/blog.astro b/src/pages/blog.astro index adbc122..842a40b 100644 --- a/src/pages/blog.astro +++ b/src/pages/blog.astro @@ -4,7 +4,12 @@ import { getCollection } from "astro:content"; import BlogEntry from "../components/BlogEntry.astro"; import Partition from "../components/Partition.astro"; import BaseLayout from "../layouts/BaseLayout.astro"; -const allPosts = await getCollection("blog"); +import { boolean } from "astro:schema"; +const allPosts = await getCollection("blog", ({ data }) => { + + return data.draft !== true; + + }); const pageTitle = "Aria's blog"; const description = "Aria's blog of assorted content"; @@ -25,5 +30,6 @@ const description = "Aria's blog of assorted content"; )) } + From 0a5d5ca92d288a03dcb2b724184f885b38a3f4ff Mon Sep 17 00:00:00 2001 From: aria Date: Wed, 21 May 2025 02:03:44 +1000 Subject: [PATCH 2/2] Add start draft for post 4 --- src/blog/post-4.mdx | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/blog/post-4.mdx diff --git a/src/blog/post-4.mdx b/src/blog/post-4.mdx new file mode 100644 index 0000000..9593c7c --- /dev/null +++ b/src/blog/post-4.mdx @@ -0,0 +1,11 @@ +--- +title: 'Following up on my identity and security' +pubDate: 2025-05-21T01:47:00.000+11 +description: 'Time to get my keys and addresses all sorted' +author: 'Aria' +tags: ["learning in public", "security", "GPG", "Storage"] +draft: true +--- +import { Picture, getImage } from "astro:assets"; + +tehe \ No newline at end of file