website/layouts/_default/cve-feed.json

20 lines
633 B
JSON

{{- $url := .Site.Params.cveFeedBucket -}}
{{- with resources.GetRemote $url -}}
{{- if .Err -}}
{{- $message := printf "Failed to retrieve CVE data: %s" .Err -}}
{{- if eq hugo.Environment "production" -}}
{{- errorf $message -}}
{{- else -}}
{{- warnf $message -}}
{{- end -}}
{{- else -}}
{{- .Content | transform.Unmarshal | jsonify -}}
{{- end -}}
{{- else -}}
{{- $message := printf "Unable to fetch CVE data from the specified URL: %q" $url -}}
{{- if eq hugo.Environment "production" -}}
{{- errorf $message -}}
{{- else -}}
{{- warnf $message -}}
{{- end -}}
{{- end -}}