diff --git a/layouts/partials/kroki/functions/svg.html b/layouts/partials/kroki/functions/svg.html index 752cc4d..c12d05c 100644 --- a/layouts/partials/kroki/functions/svg.html +++ b/layouts/partials/kroki/functions/svg.html @@ -2,12 +2,15 @@ {{- if not $ctx.type }} {{- errorf "[kroki] %s" "no diagram type specified" }} {{- end }} +{{- $type := $ctx.type | lower }} {{- $body := dict "diagram_source" $ctx.source - "diagram_type" ($ctx.type | lower) + "diagram_type" $type "output_format" "svg" }} +{{- $cacheKey := printf "kroki-%s-%s" $type ($ctx.source | md5) }} {{- $opts := dict + "key" $cacheKey "method" "post" "body" ($body | jsonify) "headers" (dict