Add the ability to support hidden draft posts

This commit is contained in:
aria 2025-05-21 02:03:33 +10:00
parent 7548baa72d
commit fce732ee41
Signed by: aria
SSH key fingerprint: SHA256:WqtcVnDMrv1lnUlNah5k31iywFUI/DV+5yHzCTO4Vds
5 changed files with 11 additions and 1 deletions

View file

@ -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";

View file

@ -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

View file

@ -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";

View file

@ -13,6 +13,7 @@ const blog = defineCollection({
description: z.string(),
author: z.string(),
tags: z.array(z.string()),
draft: z.boolean(),
}),
});

View file

@ -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";
))
}
</ul>
</Partition>
</BaseLayout>