diff --git a/themes/secluded/layouts/_default/_markup/render-codeblock-kroki.html b/themes/secluded/layouts/_default/_markup/render-codeblock-kroki.html index 8089a5f..791de0a 100644 --- a/themes/secluded/layouts/_default/_markup/render-codeblock-kroki.html +++ b/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. */}}