Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SayakMukhopadhyay
Copy link
Contributor

@SayakMukhopadhyay SayakMukhopadhyay commented Feb 12, 2025

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:

  1. The content from static/js/search.js and assets/js/search.js moved to assets/js/k8s-search.js. This helps with modification and prevents the need to override search,js from docsy/assets/js. The file is also named k8s-search.js in the same vein as Docsy has offline-search.js. This helps in indicating that their functionality are similar.
  2. This new file k8s-search.js is incorporated layouts/partials/scripts.html Docsy add all search scripts like the offline-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.
  3. The linking of the deleted /static/js/search,js is removed from layouts/_default/search.html

I also plan to rework search-input.html and associated scss files but probably in a different PR.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 12, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign natalisucks for approval. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes label Feb 12, 2025
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 12, 2025
Copy link

netlify bot commented Feb 12, 2025

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 73afeb3
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/67bc52b5095d2600081ae530
😎 Deploy Preview https://deploy-preview-49724--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sftim
Copy link
Contributor

sftim commented Feb 12, 2025

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.

Suggest opening an upstream issue about the possibility.

@SayakMukhopadhyay
Copy link
Contributor Author

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.

@sftim
Copy link
Contributor

sftim commented Feb 23, 2025

Could we adopt google/docsy#1512 anyway, and use that behind the templates.Exists guard (disabling built-in search mechanisms and using our own complicated "you might be subject to state-level censorship" search functionality)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants