Adding Searching Feature#69
Open
fabohax wants to merge 2 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Member
|
Thanks @fabohax this sounds like a great addition. @kenrogers I would love to try out the preview for this but it looks like the Vercel previews are not publicly accessible. |
|
@fabohax is attempting to deploy a commit to the stacks-team Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
It seems this got forgotten? :( |
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.
This PR introduces a searching feature to the Clarity Book project, allowing users to search across all pages. The following changes were made:
Search Index Generation:
Added
genSearchIndex.jsto generate asearch-index.jsonfile containing searchable content from Markdown files.Integrated
genSearchIndex.jsinto thebuild.jsscript to ensure the search index is generated during the build process.Search Functionality:
Added
search.jsto handle client-side search functionality.The search bar in
base.htmlnow dynamically displays search results based on user input.Build Script Enhancements:
Updated
build.jsto:Copy
search.jsto the root of the build directory assearch.js.Generate the
search-index.jsonfile during the build process.Error Handling:
Improved error handling in
search.jsto manage cases where thesearch-index.jsonfile is missing or invalid.Testing:
Verified that the
search-index.jsonfile is generated correctly during the build process.Tested the search functionality in the browser using a local HTTP server.
Notes:
Ensure the project is served via an HTTP server (e.g., python http-server) to avoid CORS issues with fetch.