fix: filter draft posts from random, feed, and sitemap

This commit is contained in:
Lewis Wynne 2026-01-29 01:54:43 +00:00
parent b62e565d38
commit 23a267a242
3 changed files with 3 additions and 3 deletions

View file

@ -9,7 +9,7 @@ const SUBDOMAINS = [
export async function GET(context: APIContext) {
const site = context.site?.origin ?? 'https://wynne.rs';
const posts = await getCollection('posts');
const posts = await getCollection('posts', ({ data }) => data.draft !== true);
const txtDir = path.join(process.cwd(), 'public/txt');
const txtFiles = fs.existsSync(txtDir)