You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Kubernetes docs website project (https://kubernetes.io / https://github.com/kubernetes/website/), we use a custom search implementation, mostly because how it handles Google search engine having geo-blocks. Unlike Docsy, where only a single search engine can be enabled at a time, we override Docsy's search handling with our own script which can switch search engines based on the geo-restrictions.
Now, in our case, the capability of Docsy to have multiple search engines is not important as I can understand that it would be infeasible for Docsy to allow arbitrary combinations of search engines. Rather, I think it would be great to have a hook in Docsy which can be used by Docsy users to add their own search functionality without needing to override multiple other files.
Right now, k8s website overrides multiple files to add our own script.
This change would also make things much cleaner for those having custom search tools like using other online search engines or local ones like Pagefind.
I would be happy to create a PR for this.
The text was updated successfully, but these errors were encountered:
Yep, that PR would also help us. Although, I would have prefered a parameter guard for the custom search and not it being automatically implemented when all search options are disabled as someone might not want search at all.
Disregard my last comment regarding the guard. I now realise that if all search options are disabled and the search-input-custom partial is not present, it will cause search to be disabled completely and hence no extra guards are needed.
Still, I wonder if it would be better to have an explicit guard.
In the Kubernetes docs website project (https://kubernetes.io / https://github.com/kubernetes/website/), we use a custom search implementation, mostly because how it handles Google search engine having geo-blocks. Unlike Docsy, where only a single search engine can be enabled at a time, we override Docsy's search handling with our own script which can switch search engines based on the geo-restrictions.
Now, in our case, the capability of Docsy to have multiple search engines is not important as I can understand that it would be infeasible for Docsy to allow arbitrary combinations of search engines. Rather, I think it would be great to have a hook in Docsy which can be used by Docsy users to add their own search functionality without needing to override multiple other files.
Right now, k8s website overrides multiple files to add our own script.
My proposal is to add a new config param
customSearch
, like we haveofflineSearch
which will disable all Docsy provided search and allow us to add aassets/js/custom-search.js
script. I think the change can be made inhttps://github.com/kubernetes/website/blob/99e78ac65cd08a900ed5c42e15e38cf6c39f556e/layouts/partials/scripts.html#L36-L37 by reassigning
jsSearch
to the contents of thecustom-search.js
file, exactly the way, offline search is done.This change would also make things much cleaner for those having custom search tools like using other online search engines or local ones like Pagefind.
I would be happy to create a PR for this.
The text was updated successfully, but these errors were encountered: