Skip to content

Index code blocks in the docs search - #107

Open
cdebled wants to merge 1 commit into
mainfrom
search-index-codeblocks
Open

cdebled wants to merge 1 commit into
mainfrom
search-index-codeblocks

Conversation

@cdebled

@cdebled cdebled commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Code blocks are excluded from the search index, so the reference section is effectively unsearchable.

  • Nextra defaults search to { codeblocks: false }, which puts data-pagefind-ignore="all" on every <pre>. Pagefind skips their contents.
  • The reference pages are mostly code blocks. /reference/cli/serve contributes 180 indexed characters, and no flag name (--host, --port, --protocol) is in the index at all.
  • Tradeoff: the option is global, so every snippet on the site gets indexed. Bigger index, more noise on tokens like await.

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