Skip to content

Commit 2769273

Browse files
authored
Merge pull request #51344 from AnshumanTripathi/anshuman/fix_offline_builds
fix: Support offline builds
2 parents bf37437 + b825276 commit 2769273

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

layouts/_default/cve-feed.rss.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
{{- warnf $message -}}
2121
{{- end -}}
2222
{{- end -}}
23+
<!-- Render last build date only if CVE feed is available, accommodating for offline builds. -->
24+
{{- if and (ne $feed nil) (ne (printf "%T" $feed) "string") -}}
2325
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
2426
<channel>
2527
<title>{{ $feed.title }}</title>
@@ -28,10 +30,7 @@
2830
<generator>Hugo -- gohugo.io</generator>
2931
<language>en-US</language>
3032
<copyright>{{ .Site.Params.Copyright_k8s }}</copyright>
31-
<!-- Render last build date only if CVE feed is available, accommodating for offline builds. -->
32-
{{- if ne $feed nil -}}
3333
<lastBuildDate>{{ time.Format "Mon, 02 Jan 2006 15:04:05 -0700" $feed._kubernetes_io.updated_at | safeHTML }}</lastBuildDate>
34-
{{- end -}}
3534
{{ with .OutputFormats.Get "RSS" -}}
3635
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
3736
{{ end -}}
@@ -47,4 +46,4 @@
4746
{{ end -}}
4847
</channel>
4948
</rss>
50-
49+
{{- end -}}

layouts/shortcodes/cve-feed.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
{{- end -}}
3434

3535
<!-- Render table only if CVE feed is available, accommodating for offline builds. -->
36-
{{ if ne $feed nil }}
36+
{{ if and (ne $feed nil) (ne (printf "%T" $feed) "string") }}
3737
<table class="security-cves">
3838
<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>
3939
<thead>

layouts/shortcodes/release-binaries.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{{- end -}}
2424

2525
<!-- Continue processing only if release binaries JSON is available, accommodating for offline builds. -->
26-
{{ if ne $response nil }}
26+
{{ if and (ne $response nil) ((ne (printf "%T" $response) "string")) }}
2727
{{ $currentVersion := site.Params.version }}
2828

2929
{{ $Binaries := slice }}
@@ -151,4 +151,4 @@
151151
</table>
152152
</div>
153153
</div>
154-
{{- end -}}
154+
{{- end -}}

0 commit comments

Comments
 (0)