Can hide blog posts
This commit is contained in:
@@ -9,7 +9,7 @@ export interface Props {
|
|||||||
|
|
||||||
const { headingLevel = 2, hideAuthor = false } = Astro.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
|
const distinctYears: number[] = posts
|
||||||
.map(post => post.data.pubDate.year)
|
.map(post => post.data.pubDate.year)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: EUHWC Toast to the Lassies 2024
|
title: EUHWC Toast to the Lassies 2024
|
||||||
|
hidden: true
|
||||||
description: >-
|
description: >-
|
||||||
At the <a href="https://www.euhwc.co.uk">EUHWC</a> Burns meet in
|
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
|
Ullapool last weekend, I had the last privilege of giving the Toast to
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ const blog = defineCollection({
|
|||||||
type: 'content',
|
type: 'content',
|
||||||
schema: z.object({
|
schema: z.object({
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
|
hidden: z.optional(z.boolean()),
|
||||||
description: z.string(),
|
description: z.string(),
|
||||||
pubDate: dateSchema,
|
pubDate: dateSchema,
|
||||||
updatedDate: z.optional(dateSchema),
|
updatedDate: z.optional(dateSchema),
|
||||||
|
|||||||
Reference in New Issue
Block a user