Can hide blog posts
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user