fix: filter draft posts from homepage index

This commit is contained in:
Lewis Wynne 2026-01-29 01:54:04 +00:00
parent df5499cf35
commit b62e565d38

View file

@ -24,7 +24,7 @@ interface TxtConfig {
pinned?: string[]; pinned?: string[];
} }
const posts = await getCollection('posts'); const posts = await getCollection('posts', ({ data }) => data.draft !== true);
// Group by category (default: "posts") // Group by category (default: "posts")
const grouped = posts.reduce((acc, post) => { const grouped = posts.reduce((acc, post) => {