--- import '@styles/prose.css'; import { getCollection, render } from 'astro:content'; import BaseLayout from '@layouts/BaseLayout.astro'; // return all posts in dev, only non-draft in prod let entries = await getCollection('posts', ({ data }) => !data.draft || import.meta.env.DEV ); entries.sort((a, b) => b.data.date.getTime() - a.data.date.getTime()); const posts = await Promise.all(entries.map(async entry => { const { remarkPluginFrontmatter } = await render(entry); return { ...entry, remarkPluginFrontmatter }; })); --- All Posts {posts.map( (p, idx) => {idx > 0 && } {p.data.title} {p.data.draft && Draft} {p.remarkPluginFrontmatter.description} )}
{p.remarkPluginFrontmatter.description}