Skip to content

Commit 2277060

Browse files
committed
update Hugo to v0.145.0 and replaces deprecated Resource.Err
Signed-off-by: The Anh Nguyen <[email protected]>
1 parent 75f19fc commit 2277060

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

layouts/_default/cve-feed.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{{- $url := .Site.Params.cveFeedBucket -}}
2-
{{- with resources.GetRemote $url -}}
3-
{{- if .Err -}}
2+
{{- with try (resources.GetRemote $url) -}}
3+
{{- with .Err -}}
44
{{- $message := printf "Failed to retrieve CVE data: %s" .Err -}}
55
{{- if eq hugo.Environment "production" -}}
66
{{- errorf $message -}}
77
{{- else -}}
88
{{- warnf $message -}}
99
{{- end -}}
1010
{{- else -}}
11-
{{- .Content | transform.Unmarshal | jsonify -}}
11+
{{- .Value | transform.Unmarshal | jsonify -}}
1212
{{- end -}}
1313
{{- else -}}
1414
{{- $message := printf "Unable to fetch CVE data from the specified URL: %q" $url -}}

layouts/_default/cve-feed.rss.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{{- $url := .Site.Params.cveFeedBucket -}}
22
{{- $feed := "" -}}
33

4-
{{- with resources.GetRemote $url -}}
5-
{{- if .Err -}}
4+
{{- with try (resources.GetRemote $url) -}}
5+
{{- with .Err -}}
66
{{- $message := printf "Failed to retrieve CVE data: %s" .Err -}}
77
{{- if eq hugo.Environment "production" -}}
88
{{- errorf $message -}}
99
{{- else -}}
1010
{{- warnf $message -}}
1111
{{- end -}}
1212
{{- else -}}
13-
{{- $feed = .Content | transform.Unmarshal -}}
13+
{{- $feed = .Value | transform.Unmarshal -}}
1414
{{- end -}}
1515
{{- else -}}
1616
{{- $message := printf "Unable to fetch CVE data from the specified URL: %q" $url -}}

layouts/shortcodes/cve-feed.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{{- $url := .Site.Params.cveFeedBucket }}
22
{{- $feed := "" -}}
33
<!-- Try to fetch remote resource from the specified URL -->
4-
{{- with resources.GetRemote $url -}}
5-
{{- if .Err -}}
4+
{{- with try (resources.GetRemote $url) -}}
5+
{{- with .Err -}}
66
<!-- Error message if retrieval fails -->
77
{{- $message := printf "Failed to retrieve CVE data: %s" .Err -}}
88
{{- if eq hugo.Environment "production" -}}
@@ -12,7 +12,7 @@
1212
{{- end -}}
1313
{{- else -}}
1414
<!-- Process the content if retrieval is successful -->
15-
{{- $feed = .Content | transform.Unmarshal -}}
15+
{{- $feed = .Value | transform.Unmarshal -}}
1616
{{- if ne $feed.version "https://jsonfeed.org/version/1.1" -}}
1717
{{- $warningMessage := "CVE feed shortcode. KEP-3203: CVE feed does not comply with JSON feed v1.1." -}}
1818
{{- if eq hugo.Environment "production" -}}

layouts/shortcodes/release-binaries.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
{{- $url := "https://raw.githubusercontent.com/kubernetes-sigs/downloadkubernetes/master/dist/release_binaries.json" }}
33
{{- $response := "" }}
44

5-
{{- with resources.GetRemote $url -}}
6-
{{- if .Err -}}
5+
{{- with try (resources.GetRemote $url) -}}
6+
{{- with .Err -}}
77
{{- $message := printf "Failed to retrieve release binaries data: %s" .Err -}}
88
{{- if eq hugo.Environment "production" -}}
99
{{- errorf $message -}}
1010
{{- else -}}
1111
{{- warnf $message -}}
1212
{{- end -}}
1313
{{- else -}}
14-
{{- $response = .Content | transform.Unmarshal }}
14+
{{- $response = .Value | transform.Unmarshal }}
1515
{{- end -}}
1616
{{- else -}}
1717
{{ $message := printf "Unable to fetch release binaries data from the specified URL: %q" $url -}}

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ command = "git submodule update --init --recursive --depth 1 && make non-product
88

99
[build.environment]
1010
NODE_VERSION = "20.17.0"
11-
HUGO_VERSION = "0.133.0"
11+
HUGO_VERSION = "0.145.0"
1212

1313
[context.deploy-preview]
1414
command = "git submodule update --init --recursive --depth 1 && make deploy-preview && npx -y pagefind --site public"

0 commit comments

Comments
 (0)