Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/trueberryless-org/mindspace. Thoughtless blogs about God and the world mindspace.trueberryless.org
Something went wrong. Try again.
123456789101112131415161718192021import { getCollection, type CollectionEntry } from 'astro:content'
/** * Get all posts, filtering out posts whose filenames start with _ */export async function getFilteredPosts() { const posts = await getCollection('posts') return posts.filter((post: CollectionEntry<'posts'>) => !post.id.startsWith('_'))}
/** * Get all posts sorted by publication date, filtering out posts whose filenames start with _ */export async function getSortedFilteredPosts() { const posts = await getFilteredPosts() return posts.sort( (a: CollectionEntry<'posts'>, b: CollectionEntry<'posts'>) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf() )}