--- import Layout from '../layouts/Layout.astro'; import { getCollection } from 'astro:content'; const posts = await getCollection('posts'); posts.sort((a, b) => new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime()); ---

~/blog

Posts from the terminal.

ls -la posts/
{posts.map((post) => (

{new Date(post.data.pubDate).toISOString().split('T')[0]} {post.data.title}

))} {posts.length === 0 && ( <>

No posts here yet

)}

cat rss.txt
Subscribe to RSS feed