Skip to content

add layout for kubectl reference index with search#54996

Open
Caesarsage wants to merge 2 commits intokubernetes:mainfrom
Caesarsage:gen-kubectl-subcommands
Open

add layout for kubectl reference index with search#54996
Caesarsage wants to merge 2 commits intokubernetes:mainfrom
Caesarsage:gen-kubectl-subcommands

Conversation

@Caesarsage
Copy link
Contributor

@Caesarsage Caesarsage commented Mar 22, 2026

Description:

Adds a custom Hugo layout and generated index page that lists all kubectl commands and subcommands in collapsible sections with search and expand/collapse controls. Each entry links to its full reference page.

preview: https://deploy-preview-54996--kubernetes-io-main-staging.netlify.app/docs/reference/kubectl/generated/

The generator code changes (used to generate the kubectl comand) approved here: kubernetes-sigs/reference-docs#425

Closes: #45558

@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 Mar 22, 2026
@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 dipesh-rawat for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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 Mar 22, 2026
@k8s-ci-robot k8s-ci-robot added language/en Issues or PRs related to English language 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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 22, 2026
@netlify
Copy link

netlify bot commented Mar 22, 2026

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 83100f9
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-io-main-staging/deploys/69bffe222f374f0008a8ad96
😎 Deploy Preview https://deploy-preview-54996--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 project configuration.

@Caesarsage Caesarsage force-pushed the gen-kubectl-subcommands branch from 1372af8 to c9d35db Compare March 22, 2026 11:09
Copy link
Member

@lmktfy lmktfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have a generated page for all subcommands, I expect that we can discover all of the page sections at site build time.
In other words: find all the child pages for some section, analyse them, and render something out based on that analysis.

Hugo would do all the hard work, once we define an algorithm.

How does that sound?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are styles for documentation, so the best place for them is in the documentation SCSS.

weight: 10
title: kubectl reference
layout: kubectl-all-subcommands
content_type: tool-reference
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, this has a weight (maybe it's an input to the generator)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. before it was a manually created file and not auto generated. Will have to revert this and try the hugo build approach

{{ partial "page-meta-lastmod.html" . }}
</div>

<script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best place for JavaScript is assets/js

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

---


<!--
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering - is there a matching PR to update the reference docs generator?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I have one locally (used to generate this file). Before raising PR for that, wanted to check if the generated file is okay first

@Caesarsage
Copy link
Contributor Author

If we have a generated page for all subcommands, I expect that we can discover all of the page sections at site build time. In other words: find all the child pages for some section, analyse them, and render something out based on that analysis.

Hugo would do all the hard work, once we define an algorithm.

How does that sound?

This is okay, we would need to add some more font matter like the description to the generated subcommands files (which will be less code on the reference docs generator)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work ? @lmktfy

@Caesarsage Caesarsage marked this pull request as ready for review March 23, 2026 01:55
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 23, 2026
@k8s-ci-robot k8s-ci-robot requested review from lmktfy and tengqm March 23, 2026 01:55
Copy link
Contributor

@tengqm tengqm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 23, 2026
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

DetailsGit tree hash: a01003c365db4888cf07b59af062fbec76838711

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. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

Add all subcommands to kubectl reference index page

4 participants