-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework the search scripts to make it closer to docsy #49724
base: main
Are you sure you want to change the base?
Rework the search scripts to make it closer to docsy #49724
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
✅ Pull request preview available for checkingBuilt without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
Suggest opening an upstream issue about the possibility. |
google/docsy#2194 has been created. I will also note the same in the comments to ensure we don't forget to incorporate it if Docsy takes in the change. |
c689333
to
746220f
Compare
746220f
to
74e17b6
Compare
Could we adopt google/docsy#1512 anyway, and use that behind the |
74e17b6
to
a56b84d
Compare
a56b84d
to
73afeb3
Compare
This is a small change towards getting the search functionality closer to Docsy. Its related to #47975 but takes a different approach to the same end. The changes made are as follows:
static/js/search.js
andassets/js/search.js
moved toassets/js/k8s-search.js
. This helps with modification and prevents the need to overridesearch,js
fromdocsy/assets/js
. The file is also namedk8s-search.js
in the same vein as Docsy hasoffline-search.js
. This helps in indicating that their functionality are similar.k8s-search.js
is incorporatedlayouts/partials/scripts.html
Docsy add all search scripts like theoffline-search.js
in this file. This addition is also done inside a.Site.Params.k8s_search
guard in the same vein that Docsy uses.Site.Params.offlineSearch
guard.As an aside, I was thinking of seeing if a "custom search" feature could be added in Docsy which would mean that we would just need to add a script and be done with any custom search functionality.
/static/js/search,js
is removed fromlayouts/_default/search.html
I also plan to rework
search-input.html
and associated scss files but probably in a different PR.