diff --git a/layouts/_partials/function/get-remote-json.html b/layouts/_partials/function/get-remote-json.html index e1c4d6bb..b690ae3c 100644 --- a/layouts/_partials/function/get-remote-json.html +++ b/layouts/_partials/function/get-remote-json.html @@ -2,17 +2,19 @@ {{- $url := .URL -}} {{- $options := .OPTIONS | default dict -}} -{{- if $url -}} - {{- $cacheKey := print $url (now.Format "2006-01-02") -}} - {{- $options = $options | merge (dict "key" $cacheKey) -}} - {{- with try (resources.GetRemote $url $options) -}} - {{- with .Err -}} - {{- erroridf "error-get-remote-json" "%s" . -}} - {{- else with .Value -}} - {{- $response = .Content | transform.Unmarshal -}} - {{- else -}} - {{- erroridf "error-get-remote-json" "Failed to get remote JSON %q" $url -}} - {{- end -}} +{{- if not $url -}} + {{- erroridf "error-get-remote-json" "URL parameter is required!" -}} +{{- end -}} + +{{- $cacheKey := print $url (now.Format "2006-01-02") -}} +{{- $options = $options | merge (dict "key" $cacheKey) -}} +{{- with try (resources.GetRemote $url $options) -}} + {{- with .Err -}} + {{- erroridf "error-get-remote-json" "%s" . -}} + {{- else with .Value -}} + {{- $response = .Content | transform.Unmarshal -}} + {{- else -}} + {{- erroridf "error-get-remote-json" "Failed to get remote JSON %q" $url -}} {{- end -}} {{- end -}} diff --git a/layouts/_partials/init/index.html b/layouts/_partials/init/index.html index a394dcde..efa02128 100644 --- a/layouts/_partials/init/index.html +++ b/layouts/_partials/init/index.html @@ -1,4 +1,4 @@ -{{- hugo.Store.Set "version" "v0.4.0-alpha.3-20251223090620-8635841c" -}} +{{- hugo.Store.Set "version" "v0.4.0-alpha.3-20251223100706-1039e328" -}} {{- .Store.Set "this" dict -}} {{- partial "init/detection-env.html" . -}}