feat: URL-driven search with skeleton loader#128
Merged
Conversation
- Support #search=... hash URLs by redirecting to ?q=... (SEO-friendly) - Early redirect in <head> prevents flash of content - Auto-open search modal with pre-filled query on ?q= page load - Add animated skeleton loader while search index loads - Build lunr index in chunks (non-blocking) to keep UI responsive - Clean up ?q= param from URL when search modal is closed - Aligns with existing SearchAction structured data in baseof.html
|
👋 @wreiske, Your documentation has been pushed to https://docs-qa.med-web.com/128-merge/ for commit 6f26f85 |
- /eh/videos/* → https://videos.enterprise.health/videos/* - /wc/videos/* → https://videos.webch.art/videos/* - 301 permanent redirect preserving path and query string
Deploying wc-docs with
|
| Latest commit: |
42c26d4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://079a4b99.wc-docs.pages.dev |
| Branch Preview URL: | https://feature-url-driven-search.wc-docs.pages.dev |
- docs.enterprisehealth.com/videos/* → https://videos.enterprise.health/videos/* - docs.webchartnow.com/videos/* → https://videos.webch.art/videos/*
Deploying eh-docs with
|
| Latest commit: |
42c26d4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c32c17f4.eh-docs.pages.dev |
| Branch Preview URL: | https://feature-url-driven-search.eh-docs.pages.dev |
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
Adds support for URL-driven search so that links like
https://docs.enterprisehealth.com/#search=testautomatically open the search modal with results.Changes
Hash-to-query redirect (
baseof.html)<script>in<head>redirects#search=...→?q=...before the page renders (no flash of content)window.location.replace()so the hash URL doesn't pollute browser historySearch modal enhancements (
main.js)?q=query param support: On page load, if?q=testis present, the search modal opens pre-filled with the query and results are shownlunr.Builderwith chunkedadd()calls (200 docs per chunk), yielding to the browser between chunks viasetTimeout(0)to keep the UI responsive?q=param is removed from the URL viahistory.replaceState()when the search modal is closedloadSearchIndex()simultaneouslySEO alignment
SearchActionstructured data inbaseof.htmlalready declares?q={search_term_string}as the search URL template — this implementation matches that contractTesting
/#search=test→ should redirect to/?q=testand show search results/?q=scheduling→ modal opens with "scheduling" pre-filled and skeleton → results?q=