Skip to content

Stardust#3066

Open
atharvadeosthale wants to merge 2 commits into
mainfrom
stardust
Open

Stardust#3066
atharvadeosthale wants to merge 2 commits into
mainfrom
stardust

Conversation

@atharvadeosthale

Copy link
Copy Markdown
Member

No description provided.

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.
Hide draft blog posts from listings, feeds, and search
@appwrite

appwrite Bot commented Jun 29, 2026

Copy link
Copy Markdown

Appwrite Website

Project ID: 69d7efb00023389e8d27

Sites (1)
Site Status Logs Preview QR
 website
69d7f2670014e24571ca
Failed Failed View Logs Preview URL QR Code

Website (appwrite/website)

Project ID: 684969cb000a2f6c0a02

Sites (1)
Site Status Logs Preview QR
 website
68496a17000f03d62013
Processing Processing View Logs Preview URL QR Code


Tip

Our Discord community has grown to 24K developers, and counting

@greptile-apps

greptile-apps Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces a first-class draft mode for blog posts: a post with draft: true in its frontmatter remains accessible by direct URL (useful for internal review) but is excluded from all public-facing listings, feeds, and LLM indexes, and its page emits a noindex meta tag.

  • publishedPosts is introduced in content.ts as the canonical filtered export, and is adopted in the blog layout, RSS/JSON feeds, llms.txt, and llms-full.txt — draft posts are now consistently hidden across every aggregation surface.
  • Post.svelte gains a draft prop (default false) that conditionally injects <meta name=\"robots\" content=\"noindex\" /> in the document head.
  • The LLM index files build a PUBLISHED_BLOG_SLUGS Set at module load time and use it to skip draft .markdoc files that would otherwise be picked up by the glob import.

Confidence Score: 4/5

Safe to merge; draft posts are consistently hidden from all public surfaces and no existing published posts are affected.

The change is narrowly scoped and the core filtering logic is correct. The two observations — JSON-LD schema still rendered for drafts, and the draft field typed as non-optional when older posts leave it undefined — are both handled safely at runtime today, but could become subtle traps as the codebase evolves.

Post.svelte — the structured-data (JSON-LD) blocks are not yet guarded by the draft flag, which is inconsistent with the noindex behaviour added in the same file.

Important Files Changed

Filename Overview
src/routes/blog/content.ts Adds publishedPosts export that filters out draft posts; uses it in getBlogEntries to keep drafts out of category listings and public post lists. Clean, single source of truth.
src/markdoc/layouts/Post.svelte Adds draft prop (default false) and injects noindex meta for drafts. JSON-LD structured data tags are still rendered unconditionally for draft posts.
src/routes/blog/+layout.ts Switches from posts to publishedPosts so the context supplied to blog layout only ever contains non-draft posts.
src/routes/blog/feed.json/+server.ts Uses publishedPosts; also fixes the pre-existing Object.keys(posts).length to the cleaner publishedPosts.length.
src/routes/blog/rss.xml/+server.ts Switches to publishedPosts so draft posts never appear in the RSS feed.
src/routes/llms.txt/+server.ts Builds PUBLISHED_BLOG_SLUGS from publishedPosts and uses it to gate blog post entries; draft posts are now excluded from the LLMs index.
src/routes/llms-full.txt/+server.ts Same PUBLISHED_BLOG_SLUGS guard as llms.txt; draft posts excluded from the full LLMs content dump.

Comments Outside Diff (2)

  1. src/markdoc/layouts/Post.svelte, line 160-179 (link)

    P2 The JSON-LD structured data blocks (createPostSchema and createBreadcrumbsSchema) are emitted unconditionally, so a draft post that gets crawled will still expose schema.org article metadata to search engines. Since noindex is already set, wrapping the schema blocks in {#if !draft} would keep all indexing signals consistent.

  2. src/routes/blog/content.ts, line 20-21 (link)

    P2 draft typed as non-optional boolean but effectively boolean | undefined at runtime. Posts authored before this feature was added have no draft key in their frontmatter, so frontmatter.draft is undefined. All consuming code (!post.draft, !(post.draft ?? false)) handles this gracefully, but the interface declares draft: boolean (not draft?: boolean), which is a type mismatch. Any code that explicitly compares post.draft === false (as opposed to !post.draft) could silently miss un-flagged posts.

Reviews (1): Last reviewed commit: "Merge pull request #3065 from appwrite/s..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant