Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

fix: draft pages appear in search results

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

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.

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`)
Dominant language
TypeScript
Stars
2
Forks
1
Avg merge
13h 36m
Merged PRs (30d)
11

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

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.

More from raystack/chronicle

All issues in raystack/chronicle

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.