Open
Conversation
🌿 Documentation Preview
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements the exclusion of hidden pages and their descendants from the Algolia search index while maintaining their routing capabilities. The implementation uses a propagating isAncestorHidden flag that flows through the visitor pattern, ensuring that any page or section within a hidden section is also excluded from search results.
Changes:
- Added
isAncestorHiddenoptional parameter to visitor configuration interface - Modified section, page, and API reference visitors to check ancestor hidden status before creating Algolia records
- Implemented hidden status propagation from parent sections to all descendants
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/content-indexer/visitors/index.ts | Added isAncestorHidden optional parameter to VisitorConfigBase interface with documentation |
| src/content-indexer/visitors/visit-section.ts | Added check for ancestor hidden status when creating Algolia records and propagates hidden status to children |
| src/content-indexer/visitors/visit-page.ts | Added isAncestorHidden parameter and check before creating Algolia records |
| src/content-indexer/visitors/visit-api-reference.ts | Combines ancestor hidden status with item's own hidden status for API references |
| src/content-indexer/visitors/tests/visit-section.test.ts | Added three comprehensive tests covering hidden section overview, children of hidden sections, and nested sections |
| src/content-indexer/visitors/tests/visit-page.test.ts | Added test verifying pages within hidden ancestors are excluded from Algolia index |
| src/content-indexer/visitors/tests/visit-api-reference.test.ts | Added test verifying API references within hidden ancestors are excluded from Algolia index |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
Made Algolia index skip hidden pages.
Related Issues
https://linear.app/alchemyapi/issue/DX-2283/prevent-hidden-pages-from-appearing-in-searches
Changes Made
The sub-pages will get skipped correctly if the section is hidden.
Testing
Added tests