Exclude internal documentation from search index#1449
Open
Exclude internal documentation from search index#1449
Conversation
Internal design/planning docs were showing up in the public docs search. Use the _render hook to return empty content for pages under internal/, effectively removing them from the search index. https://claude.ai/code/session_01WnDaJ4qzuJiQaAkkmjkUnd
Skip the md.render() call entirely for internal docs pages rather than rendering then discarding. https://claude.ai/code/session_01WnDaJ4qzuJiQaAkkmjkUnd
Shows content excerpts with highlighted matching terms in the search popup, making it easier to evaluate results at a glance. https://claude.ai/code/session_01WnDaJ4qzuJiQaAkkmjkUnd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updated the VitePress search configuration to exclude internal documentation pages from the search index by implementing a custom render function.
Changes
_renderfunction that filters out pages in theinternal/directoryinternal/path prefix now return empty strings instead of being indexed, effectively removing them from search resultsImplementation Details
The custom render function intercepts the markdown rendering process and checks if the document's
relativePathstarts with"internal/". If it does, an empty string is returned instead of the rendered HTML, preventing those pages from appearing in search results while keeping them accessible via direct navigation.https://claude.ai/code/session_01WnDaJ4qzuJiQaAkkmjkUnd