fix(kroki): update error handling pattern for newer Hugo

Amolith created

Change summary

themes/secluded/layouts/_default/_markup/render-codeblock-kroki.html | 8 
1 file changed, 4 insertions(+), 4 deletions(-)

Detailed changes

themes/secluded/layouts/_default/_markup/render-codeblock-kroki.html 🔗

@@ -91,14 +91,14 @@ References:
 {{- /* Get diagram. */}}
 {{- $body := dict "diagram_source" $inner "diagram_type" $diagramType "output_format" "SVG" "diagram_options" $diagram_opts | jsonify }}
 {{- $opts := dict "method" "post" "body" $body }}
-{{- with resources.GetRemote $apiEndpoint $opts }}
+{{- with try (resources.GetRemote $apiEndpoint $opts) }}
   {{- with .Err }}
     {{- errorf "The %q code block render hook was unable to get the remote diagram. See %s. %s" $renderHookName $position . }}
-  {{- else }}
+  {{- else with .Value }}
     {{- $attrs = merge $attrs (dict "src" .RelPermalink) }}
+  {{- else }}
+    {{- errorf "The %q code block render hook was unable to get the remote diagram. See %s" $renderHookName $position }}
   {{- end }}
-{{- else }}
-  {{- errorf "The %q code block render hook was unable to get the remote diagram. See %s" $renderHookName $position }}
 {{- end }}
 
 {{- /* Render. */}}