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

Omit “Edit this page” links for generated content #27393

Conversation

sftim
Copy link
Contributor

@sftim sftim commented Apr 3, 2021

Copy the page meta links template from Docsy and adapt it to only suggest editing pages when they aren't autogenerated.

Previews:

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 3, 2021
@k8s-ci-robot k8s-ci-robot added the sig/docs Categorizes an issue or PR as relevant to SIG Docs. label Apr 3, 2021
Comment on lines +25 to +28
{{ if not (.Param "auto_generated") }}
<a href="{{ $editURL }}" target="_blank"><i class="fa fa-edit fa-fw"></i> {{ T "post_edit_this" }}</a>
<a href="{{ $newPageURL }}" target="_blank"><i class="fa fa-edit fa-fw"></i> {{ T "post_create_child_page" }}</a>
{{ end }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the new bit

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if all generated pages have this parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They might not, but if they don't then I think no harm done?

@sftim
Copy link
Contributor Author

sftim commented Apr 3, 2021

/area web-development

@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 Apr 3, 2021
@sftim
Copy link
Contributor Author

sftim commented Apr 3, 2021

Relevant to issue #23889

@netlify
Copy link

netlify bot commented Apr 3, 2021

Deploy preview for kubernetes-io-master-staging ready!

Built with commit d6589e0

https://deploy-preview-27393--kubernetes-io-master-staging.netlify.app

@kbhawkey
Copy link
Contributor

kbhawkey commented Apr 3, 2021

Yes, indeed.

@@ -0,0 +1,41 @@
/* template adapted from Docsy theme */
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, that's wrong. I didn't see it locally - maybe I didn't check properly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel this merits a 🤦!

@sftim sftim force-pushed the 20210403_omit_edit_link_for_generated_content branch from b301fdb to d241050 Compare April 3, 2021 17:36
@sftim
Copy link
Contributor Author

sftim commented Apr 6, 2021

PR #27429 is an example of a PR where this would eventually help. We'd also need to teach the API reference generator to mark its pages as autogenerated, or change the criteria for exclusion.

Copy the page meta links template from the Docsy theme, and adapt it to only
suggest editing pages that aren't autogenerated.
@sftim sftim force-pushed the 20210403_omit_edit_link_for_generated_content branch from d241050 to d6589e0 Compare April 8, 2021 21:04
@kbhawkey
Copy link
Contributor

kbhawkey commented Apr 9, 2021

Thanks @sftim .
/lgtm

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

LGTM label has been added.

Git tree hash: 00d6f01f03501bd066cf4273289662812d08192e

@kbhawkey
Copy link
Contributor

Moving this PR forward. Thanks @sftim !
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kbhawkey

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 18, 2021
@k8s-ci-robot k8s-ci-robot merged commit 140c764 into kubernetes:master Apr 18, 2021
@sftim sftim deleted the 20210403_omit_edit_link_for_generated_content branch June 9, 2021 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. 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. 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants