diff --git a/config.toml b/config.toml index 7c50e6f5..93be407e 100644 --- a/config.toml +++ b/config.toml @@ -1,5 +1,5 @@ [module] [module.hugoVersion] extended = true -min = "0.137.0" +min = "0.141.0" max = "0.148.1" \ No newline at end of file diff --git a/layouts/shortcodes/codeberg.html b/layouts/shortcodes/codeberg.html index ccaeca18..787db9e4 100644 --- a/layouts/shortcodes/codeberg.html +++ b/layouts/shortcodes/codeberg.html @@ -1,6 +1,16 @@ {{ $id := delimit (slice "codeberg" (partial "functions/uid.html" .)) "-" }} {{- $codebergURL := print "https://codeberg.org/api/v1/repos/" (.Get "repo") -}} -{{- $codebergData := resources.GetRemote $codebergURL | transform.Unmarshal -}} +{{- $codebergData := dict -}} +{{- with try (resources.GetRemote $codebergURL) -}} + {{- with .Err -}} + {{- warnf "codeberg shortcode: failed to fetch remote resource from %q: %s" $codebergURL .Position -}} + {{- else with .Value -}} + {{- $codebergData = . | transform.Unmarshal -}} + {{- else -}} + {{- warnf "codeberg shortcode: unable to get remote resource from %q: %s" $codebergURL .Position -}} + {{- end -}} +{{- end -}} + {{- with $codebergData -}}