diff --git a/apps/www/src/pages/feed.xml.ts b/apps/www/src/pages/feed.xml.ts index 78478ba..6b13096 100644 --- a/apps/www/src/pages/feed.xml.ts +++ b/apps/www/src/pages/feed.xml.ts @@ -19,7 +19,7 @@ interface TxtFile { } export async function GET(context: APIContext) { - const posts = await getCollection('posts'); + const posts = await getCollection('posts', ({ data }) => data.draft !== true); const bookmarks = yaml.load(bookmarksRaw) as Bookmark[]; const txtDir = path.join(process.cwd(), 'public/txt'); diff --git a/apps/www/src/pages/random.ts b/apps/www/src/pages/random.ts index 780fc56..40a11ac 100644 --- a/apps/www/src/pages/random.ts +++ b/apps/www/src/pages/random.ts @@ -15,7 +15,7 @@ interface Bookmark { 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 bookmarks = yaml.load(bookmarksRaw) as Bookmark[]; const txtDir = path.join(process.cwd(), 'public/txt'); diff --git a/apps/www/src/pages/sitemap.txt.ts b/apps/www/src/pages/sitemap.txt.ts index a823f9d..921e6c8 100644 --- a/apps/www/src/pages/sitemap.txt.ts +++ b/apps/www/src/pages/sitemap.txt.ts @@ -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)