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

Redo code_sample shortcode #46362

Merged
merged 3 commits into from
May 15, 2024

Conversation

sftim
Copy link
Contributor

@sftim sftim commented May 13, 2024

Refactor shortcodes:

  • code_sample
  • codenew (legacy)
  • code (legacy)

and make the text localizable. The new approach uses Hugo Pipes to get the image, allowing further improvements such as image optimization at build time.

Also, add some padding around the icon (second third commit).

Example vs preview

/area web-development

This paves an easier path for right to left locale support.

@k8s-ci-robot k8s-ci-robot added area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes sig/docs Categorizes an issue or PR as relevant to SIG Docs. labels May 13, 2024
@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 May 13, 2024
@sftim sftim force-pushed the 20240514_redo_code_sample branch from 72622b0 to 7da67f6 Compare May 13, 2024 23:58
Copy link

netlify bot commented May 13, 2024

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 72622b0
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/6642a8b41ad97600089b8f25
😎 Deploy Preview https://deploy-preview-46362--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.

Copy link

netlify bot commented May 14, 2024

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit e2d9c4f
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/6642abcb8da9330008873338
😎 Deploy Preview https://deploy-preview-46362--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 added 3 commits May 14, 2024 01:09
Use Hugo Pipes for the icon asset pipeline, and avoid inline styling.
Allow localizations to customize the tooltip for copying code samples to
the clipboard.
@sftim sftim force-pushed the 20240514_redo_code_sample branch from 7da67f6 to e2d9c4f Compare May 14, 2024 00:09
@k8s-ci-robot k8s-ci-robot added the language/en Issues or PRs related to English language label May 14, 2024
@sftim
Copy link
Contributor Author

sftim commented May 14, 2024

/area localization

@k8s-ci-robot k8s-ci-robot added the area/localization General issues or PRs related to localization label May 14, 2024
Copy link
Member

@dipesh-rawat dipesh-rawat left a comment

Choose a reason for hiding this comment

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

Nice improvements! Positive changes with Hugo pipes for images, localized strings, CSS improvement and potential RTL support in the future. Also, the changes render as expected in the preview page.

/lgtm

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

LGTM label has been added.

Git tree hash: af05b0123864322cca8d73ccffcb070acae5f192

@reylejano
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: reylejano

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 May 15, 2024
@k8s-ci-robot k8s-ci-robot merged commit b9475dc into kubernetes:main May 15, 2024
6 checks passed
@sftim sftim deleted the 20240514_redo_code_sample branch May 15, 2024 20:05
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/localization General issues or PRs related to localization 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/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.

4 participants