Skip to content

Adding Searching Feature#69

Open
fabohax wants to merge 2 commits into
clarity-lang:mainfrom
fabohax:main
Open

Adding Searching Feature#69
fabohax wants to merge 2 commits into
clarity-lang:mainfrom
fabohax:main

Conversation

@fabohax

@fabohax fabohax commented Apr 25, 2025

Copy link
Copy Markdown

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.js to generate a search-index.json file containing searchable content from Markdown files.
Integrated genSearchIndex.js into the build.js script to ensure the search index is generated during the build process.

Search Functionality:

Added search.js to handle client-side search functionality.
The search bar in base.html now dynamically displays search results based on user input.

Build Script Enhancements:

Updated build.js to:
Copy search.js to the root of the build directory as search.js.
Generate the search-index.json file during the build process.

Error Handling:

Improved error handling in search.js to manage cases where the search-index.json file is missing or invalid.

Testing:
Verified that the search-index.json file 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.

@vercel

vercel Bot commented Apr 25, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clarity-book ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 25, 2025 5:27am

@MarvinJanssen

Copy link
Copy Markdown
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.

@vercel

vercel Bot commented Oct 17, 2025

Copy link
Copy Markdown

@fabohax is attempting to deploy a commit to the stacks-team Team on Vercel.

A member of the Team first needs to authorize it.

@fabohax

fabohax commented Jun 11, 2026

Copy link
Copy Markdown
Author

It seems this got forgotten? :(

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.

2 participants