Skip to content

Commit 3d850f6

Browse files
committed
Clean CVE feed shortcode i18n caption data
Previsouly we were using two data items: ```toml [cve_table_date_before] other = "(last updated: " [cve_table_date_after] other = ")" ``` Which was simplified, using printf, to: ```toml [cve_table_date_format_string] other = "(last updated: %s)" ``` This is related to the following discussion #38579 (comment)
1 parent 7a81702 commit 3d850f6

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

data/i18n/en/en.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,11 @@ other = "Issue Summary"
5555
[cve_table]
5656
other = "Official Kubernetes CVE List"
5757

58-
[cve_table_date_before]
59-
other = "(last updated: "
60-
6158
[cve_table_date_format]
6259
other = "02 Jan 2006 15:04:05 MST"
6360

64-
[cve_table_date_after]
65-
other = ")"
61+
[cve_table_date_format_string]
62+
other = "(last updated: %s)"
6663

6764
[deprecation_title]
6865
other = "You are viewing documentation for Kubernetes version:"

layouts/shortcodes/cve-feed.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{ errorf "Build Failed. CVE feed does not comply with JSON feed v1.1" }}
44
{{ end }}
55
<table class="security-cves">
6-
<caption style="caption-side: top;">{{ T "cve_table" }} {{ T "cve_table_date_before" }}{{ $feed._kubernetes_io.updated_at | time.Format ( T "cve_table_date_format" ) }}{{ T "cve_table_date_after" }}</caption>
6+
<caption style="caption-side: top;">{{ T "cve_table" }} {{ printf (T "cve_table_date_format_string") ($feed._kubernetes_io.updated_at | time.Format (T "cve_table_date_format")) }}</caption>
77
<thead>
88
<tr>
99
<th>{{ T "cve_id" }}</th>

0 commit comments

Comments
 (0)