-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
The template no longer works with the latest version of hugo, due to two breaking changes:
- Removal of .Err on resources in favor of try based error handling.
- Removal of
site.IsServerin favor ofhugo.IsServer.
I was able to get it working fairly easily by making changes here and to hugo-mod-image and hugo-mod-resource. I can submit PR's if you want but I made some changes along the way like changing module names, getting rid of _vendor, and making unnecessary version tags that you probably don't want.
The actual fix is pretty simple. Convert GetRemote calls like this:
{{- with resources.GetRemote $url.String }}
{{- with .Err }}
{{- $msg := print $errorMsg ". " . }}
{{- partial "error-msg" (dict "caller" $name "ctx" $ctx "errorMsg" $msg "errorLevel" $errorLevel ) }}
{{- else }}
{{- $r = . }}
{{ end }}
{{- else }}
To something like this:
{{- with try (resources.GetRemote $url.String) }}
{{- with .Err }}
{{- $msg := print $errorMsg ". " . }}
{{- partial "error-msg" (dict "caller" $name "ctx" $ctx "errorMsg" $msg "errorLevel" $errorLevel ) }}
{{- else with .Value }}
{{- $r = . }}
{{- else }}
{{ errorf "Unable to get remote resource %q" $url }}
{{ end }}
{{- else }}
Thanks for sharing your work! I hope this helps.
Metadata
Metadata
Assignees
Labels
No labels