Something went wrong. Try again.
Fork of Chiri for Astro for my blog forked from quillmatiq.com/augment
Something went wrong. Try again.
1234567891011121314151617181920import { 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() )}