Hide draft blog posts from listings, feeds, and search#3065
Hide draft blog posts from listings, feeds, and search#3065atharvadeosthale wants to merge 1 commit into
Conversation
A blog post with `draft: true` in frontmatter stays reachable at its direct URL but is excluded from the blog listing (plus featured hero and pagination), author pages, category pages and chips, the "read next" list, RSS, the JSON feed, and the llms.txt / llms-full.txt aggregators. It also emits a noindex robots meta so search engines drop it while the URL stays live. Implemented via a single publishedPosts (non-draft) source of truth in blog/content.ts, reused across the blog layout context, feeds, and llms generators. unlisted behavior is unchanged.
Appwrite WebsiteProject ID: Website (appwrite/website)Project ID: Tip MCP server integration brings LLM superpowers to Claude Desktop and Cursor IDE |
Greptile SummaryThis PR introduces a
Confidence Score: 4/5Safe to merge; draft filtering is consistent across all public surfaces and the direct URL keeps working as intended. All seven changed files apply the draft filter in a consistent, single-source-of-truth way. The one minor observation is the redundant !(post.draft ?? false) check inside Post.svelte's read next filter — the context already contains only published posts, so the extra guard never fires, but it could mislead a future reader. No data loss, no broken URLs, and no feed regressions were found. No files require special attention; all changes are straightforward and self-consistent. Important Files Changed
|


What
Makes
draft: truein a blog post's frontmatter hide the post everywhere except its own direct URL.A draft post:
/blog/post/<slug>(renders normally)/blog/rss.xml), the JSON feed (/blog/feed.json), andllms.txt/llms-full.txt<meta name="robots" content="noindex">so search engines drop it while the URL stays liveHow
A single source of truth: a new
publishedPosts(non-draft) export inblog/content.ts, reused by:getBlogEntries()for the listing and category chipsrss.xml,feed.json)llmsgenerators (matched by slug)Post.sveltegains adraftprop and the conditionalnoindexmeta. The post route itself is untouched, so the URL keeps working.unlistedbehavior is unchanged.Testing
svelte-check: 0 errors, 0 warningsnoindex; published posts are unaffectedCall-outs (not included here)
server/sitemap.js) builds from the route manifest, not frontmatter, so a draft URL can still appear insitemap.xml.noindexstill prevents indexing; excluding it from the sitemap would be a small follow-up.