Repository navigation
Address more review feedback on site search - #4
Merged
Merged
Conversation
The search button had no visible text, only Pagefind's icon and the keyboard shortcut, in grey on a fill and border that barely differ from the header. It now shows "Search", which Pagefind leaves out in compact mode. Pagefind's default label is its lowercase "search" keyboard hint, so the label is set explicitly. The label and icon use the GitHub button's text colour, valkey-io#444 (9.24:1 on the button's #f8f9fa). Pagefind's #767676 is 4.31:1 there, below the 4.5:1 that text needs. Only the button is affected; the modal keeps Pagefind's colours. From 1025px to 1100px, just above the mobile menu, the nav doesn't fit the label and the shortcut, so the shortcut is hidden there, as on touch devices. The shortcut still works. In the mobile menu, the label is centred like the GitHub button's. Signed-off-by: notleowang <leo.wang@improving.com>
The search button now sits between the nav links and the GitHub button, so it's next to the other links rather than at the end of the header. In the mobile menu, it's above the GitHub button. The keyboard order follows the visual order. Signed-off-by: notleowang <leo.wang@improving.com>
Collaborator
Author
1 and 3. Search label, contrast and position
TestingChecked in headless Chrome with the built site, and locally in the browser:
|
Collaborator
Author
1 and 3. Follow-up & My SuggestionsHeader layout ideas, outside this PR While working on the search button, two header ideas came up. They change the existing header design, so I've kept them out of this PR and am suggesting them for a later change:
These may be worth considering together, since a smaller GitHub button would also make the search bar's position stand out more. Happy to try either in a follow-up if they sound useful. |
Searching "migration" showed "Migration from Redis to Valkey" third, behind the atomic slot migration blog post and topic, which mention the word more. Each [[boost]] in _data/search.toml gives a page's URL and the keywords it should rank higher for. default.html adds the page's keywords as Pagefind metadata, and search.js gives that field a weight of 10 with Pagefind's metaWeights, twice its default title boost. The boost only applies to searches matching the keywords, and pages titled exactly what was searched still come first. The boosts are in a file rather than front matter because docs topics and commands come from other repositories; the file works for any page. A boost is keyed by URL, so it needs updating if its page moves. /topics/migration/ is boosted for "migration", and a ranking case checks that it's the first result. Signed-off-by: notleowang <leo.wang@improving.com>
Collaborator
Author
6. Boosting pages in searchCommit: dd3da60 Searching "migration" showed Migration from Redis to Valkey third, behind the atomic slot migration blog post and topic, which mention the word more often.
Related, not implemented here
Testing
|
1 task done
2 of 3 tasks
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
Continues #3, with more changes for the review from @stockholmux on valkey-io#723, to be merged into
site-search. #3 is merged, so this PR picks up the remaining items.Review items
Done in #3: 5 (closing search scrolls to the top), 8 (result template in a JS string), 9 and 10 (breadcrumbs).
Each item's changes are described in a comment, linked from the list above.
Check List
--signoff