From a1761363fa1b1517f1ad34f3b1fa9e42d00a3d83 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Sun, 29 Mar 2026 19:15:23 +0700 Subject: [PATCH] fix(website): respect draft frontmatter field when filtering posts Posts with `draft: true` in frontmatter were shown because isDraft only checked the file path for `/drafts/`. Now checks both path and frontmatter. --- packages/website/src/posts.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/website/src/posts.ts b/packages/website/src/posts.ts index dad83548a..908993746 100644 --- a/packages/website/src/posts.ts +++ b/packages/website/src/posts.ts @@ -40,10 +40,10 @@ function loadPosts(includeDrafts: boolean): Post[] { const posts: Post[] = []; for (const [path, raw] of Object.entries(postModules)) { - const isDraft = path.includes("/drafts/"); + const { data, content } = parseFrontmatter(raw); + const isDraft = path.includes("/drafts/") || data.draft === "true"; if (isDraft && !includeDrafts) continue; - const { data, content } = parseFrontmatter(raw); const fileName = path.split("/").pop()!.replace(".md", ""); const slug = isDraft ? `drafts/${fileName}` : fileName;