Repository navigation
Add a search page that can be linked to with ?q= - #5
Merged
Merged
Conversation
The result template was part of the modal's include. It's now templates/includes/search-result.html, which the modal includes, so the upcoming search page can show results with the same template. The modal's markup is unchanged. Signed-off-by: notleowang <leo.wang@improving.com>
/search/?q=<query> shows the search results for <query>, so a search can be linked to and shared. It shows the same results as the search modal, with the same template, ranking, keyword boosts and exact title matches first. q follows what's typed once typing pauses, on <pagefind-input>'s debounce, with replaceState so Back still goes to the previous page. The page uses its own Pagefind instance, so searching in the header on the search page doesn't change the page's results. search.js now sets up each instance the same way. The page's elements are in a <template>, as the modal's are, so their instance is configured before they start. The page isn't indexed itself. It's marked data-search-unindexed, which build/check-search-index.py now skips. The result breadcrumb's style applies on the page as well as in the modal. Signed-off-by: notleowang <leo.wang@improving.com>
1 task done
2 tasks done
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
Adds a search page for the review from @stockholmux on valkey-io#723, to be merged into
site-search. Follows #3 and #4./search/?q=<query>shows the search results for<query>, so a search can be linked to and shared.qupdates once typing pauses (on<pagefind-input>'s 300 ms debounce). It usesreplaceState, so Back still goes to the previous page rather than through each search. Clearing the search removesq.build/check-search-index.pydoesn't expect it.Review items
qparameter, which Google Analytics' site search tracking can read, so tracking can be added on top of it later.Backlog
/search/?q=….Testing
Built locally (Zola 0.23.6, Pagefind 1.6.0) and checked in headless Chrome and in the browser:
/search/?q=migrationshows "migration" in the search box, "65 results for migration", and Migration from Redis to Valkey first./search/shows an empty, focused search box and no results.q(for example?q=acl+setuser, withACL SETUSERfirst), without adding history entries. Clearing removesq.build/check-search-index.py: 794 pages indexed, 0 problems, with/search/not indexed. All 26 ranking cases pass.Check List
--signoff