Skip to content

Commit

Permalink
Clean CVE feed shortcode i18n caption data
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
mtardy committed Feb 28, 2023
1 parent e6b2eaa commit 1ba4f17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions data/i18n/en/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,11 @@ other = "Issue Summary"
[cve_table]
other = "Official Kubernetes CVE List"

[cve_table_date_before]
other = "(last updated: "

[cve_table_date_format]
other = "02 Jan 2006 15:04:05 MST"

[cve_table_date_after]
other = ")"
[cve_table_date_format_string]
other = "(last updated: %s)"

[deprecation_title]
other = "You are viewing documentation for Kubernetes version:"
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/cve-feed.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{ errorf "Build Failed. CVE feed does not comply with JSON feed v1.1" }}
{{ end }}
<table class="security-cves">
<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>
<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>
<thead>
<tr>
<th>{{ T "cve_id" }}</th>
Expand Down

0 comments on commit 1ba4f17

Please sign in to comment.