kubernetes / kubernetes/website

Migrate all `code` and `codenew` shortcodes to `code_sample`

Open
#56,580 4 comments 0 reactions 0 assignees View on GitHub
area/web-development kind/cleanup priority/important-longterm sig/docs triage/accepted
Dominant language
HTML
Stars
5.4k
Forks
15.7k
Avg merge
4d 18h
Merged PRs (30d)
204

Description

While working on another issue (#56569), I found out that we currently have 3 identical shortcodes: `code`, `codenew`, and `code_sample`. Here's the issue revealing its story (#42203), but briefly: we had `codenew` and wanted to rename it to `code`, but during this migration decided to stick with `code_sample` because it's easier (than simple `code`) to find with `grep` and alike. Today, we have:
- `code` used across _two_ English pages (and _one_ `zh-cn` page);
- `codenew` used across _zero_ English pages (and a few pages, but across _numerous_ localisations);
- `code_sample` used everywhere else.

Since the first two shortcodes are barely in use, I suggest facilitating our migration to `code_sample`, hopefully resulting in the complete removal of [outdated] `/shortcodes/code.html` and `/shortcodes/codenew.html` files. Currently:
- `code.html` and `codenew.html` are completely identical;
- `code_sample.html` is a more advanced version of them, but still compatible (so there would be a simple replacement of `{{% code[new] ...` to `{{% code_sample ...`).

If that sounds reasonable, I'm ready to prepare all relevant PRs across all the localisations involved.

Contributor guide

Open the contributing guide

Research direction

Start by searching the English and localized content for `code` and `codenew` shortcode uses, then inspect `/shortcodes/code.html`, `/shortcodes/codenew.html`, and `/shortcodes/code_sample.html` to confirm compatibility. Replace the remaining uses with `code_sample` across the affected localisations and remove the two outdated shortcode files. Done means no relevant `code` or `codenew` uses remain and the migration covers the listed language pages.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
documentation
Issue type
Refactor
Difficulty
3/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.