Can hide blog posts

This commit is contained in:
Joe Carstairs
2024-06-11 11:27:00 +01:00
parent fe154c01cf
commit 952c90bbbf
3 changed files with 3 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ export interface Props {
const { headingLevel = 2, hideAuthor = false } = Astro.props;
const posts = (await getCollection('blog'));
const posts = (await getCollection('blog')).filter((post) => !post.data.hidden);
const distinctYears: number[] = posts
.map(post => post.data.pubDate.year)

View File

@@ -1,5 +1,6 @@
---
title: EUHWC Toast to the Lassies 2024
hidden: true
description: >-
At the <a href="https://www.euhwc.co.uk">EUHWC</a> Burns meet in
Ullapool last weekend, I had the last privilege of giving the Toast to

View File

@@ -10,6 +10,7 @@ const blog = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
hidden: z.optional(z.boolean()),
description: z.string(),
pubDate: dateSchema,
updatedDate: z.optional(dateSchema),