raystack / raystack/chronicle

fix: draft pages appear in search results

Open Beginner friendly
#128 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2
Forks
1
Avg merge
12h 29m
Merged PRs (30d)
12

Description

Problem

`src/server/build-search-index.ts` indexes all .md/.mdx files without checking the `draft` frontmatter field. Pages marked as drafts are findable via search, leaking unpublished content.

The runtime search handler (`src/server/api/search.ts`) uses `getPagesForVersion()` which may already filter drafts, but the static index builder (`build-search-index.ts`) does its own file scanning without this check.

Suggested Fix

  • Check `fm.draft === true` in `scanContent()` and skip those pages
  • Verify the runtime `buildDocs()` in `search.ts` also excludes drafts (it uses `getPagesForVersion` → `getPages` which filters via `isDraft`)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/server/build-search-index.ts at scanContent(), then inspect src/server/api/search.ts and its buildDocs() path to confirm the runtime behavior. The work is done when pages with draft frontmatter are excluded from the static search index and runtime search remains consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, search
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.