Skip to content

Commit e277fe5

Browse files
committed
Update CVE feed layouts for new JSON feed format
Also add information about last update time on CVE table
1 parent 883bccd commit e277fe5

File tree

3 files changed

+16
-31
lines changed

3 files changed

+16
-31
lines changed

data/i18n/en/en.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,14 @@ other = "Issue Summary"
6767
[cve_table]
6868
other = "Official Kubernetes CVE List"
6969

70-
[cve_url]
71-
other = "CVE URL"
70+
[cve_table_date_before]
71+
other = "(last updated: "
72+
73+
[cve_table_date_format]
74+
other = "02 Jan 2006 15:04:05 MST"
75+
76+
[cve_table_date_after]
77+
other = ")"
7278

7379
[deprecation_title]
7480
other = "You are viewing documentation for Kubernetes version:"

layouts/_default/cve-feed.json

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1 @@
1-
{
2-
"version": "https://jsonfeed.org/version/1.1",
3-
"title": "Auto-refreshing Official CVE Feed",
4-
"home_page_url": "https://kubernetes.io",
5-
"feed_url": "https://kubernetes.io/docs/reference/issues-security/official-cve-feed/index.json",
6-
"description": "Auto-refreshing official CVE feed for Kubernetes repository",
7-
"authors": [
8-
{
9-
"name": "Kubernetes Community",
10-
"url": "https://www.kubernetes.dev"
11-
}
12-
],
13-
"items": [
14-
{{ range $i, $e := getJSON .Site.Params.cveFeedBucket }}
15-
{{ if $i }}, {{ end }}
16-
{
17-
{{ T "cve_json_id" | jsonify }}: {{ .cve_id | jsonify }},
18-
{{ T "cve_json_url" | jsonify }}: {{ .issue_url | jsonify }},
19-
{{ T "cve_json_external_url" | jsonify }}: {{ .cve_url | jsonify}},
20-
{{ T "cve_json_summary" | jsonify }}: {{ replace (.summary | jsonify ) "\\u003e" ">" }}
21-
}{{ end }}
22-
]
23-
}
1+
{{ getJSON .Site.Params.cveFeedBucket | jsonify }}

layouts/shortcodes/cve-feed.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
<table class="security-cves">
2-
<caption>{{ T "cve_table" }}</caption>
2+
{{ $feed := getJSON .Site.Params.cveFeedBucket }}
3+
<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>
34
<thead>
45
<tr>
56
<th>{{ T "cve_id" }}</th>
6-
<th>{{ T "cve_summary"}}</th>
7+
<th>{{ T "cve_summary" }}</th>
78
<th>{{ T "cve_issue_url" }}</th>
89
</tr>
910
</thead>
1011
<tbody>
11-
{{ range $issues := getJSON .Site.Params.cveFeedBucket }}
12+
{{ range $feed.items }}
1213
<tr>
13-
<td><a href="{{ .cve_url }}">{{ .cve_id | htmlEscape | safeHTML }}</a></td>
14+
<td><a href="{{ .url }}">{{ .id | htmlEscape | safeHTML }}</a></td>
1415
<td>{{ .summary | htmlEscape | safeHTML }}</td>
15-
<td><a href="{{ .issue_url }}">#{{ .number }}</a></td>
16+
<td><a href="{{ .url }}">#{{ ._kubernetes_io.issue_number }}</a></td>
1617
</tr>
1718
{{ end }}
1819
</tbody>
19-
</table>
20+
</table>

0 commit comments

Comments
 (0)