Skip to content
Snippets Groups Projects
Commit c9a9a16f authored by Sietze van Buuren's avatar Sietze van Buuren
Browse files

Make svg short-code backwards compatible


With this change, the short-code should accept both a single positional argument as well as named arguments.

Signed-off-by: default avatarSietze van Buuren <Sietze.vanBuuren@de.bosch.com>
parent 346ba732
No related branches found
No related tags found
1 merge request!588Make svg short-code backwards compatible
Pipeline #660166 passed with warnings
{{ $src := .Get "src" }}
{{ $alignment := or (.Get "align") "center" }}
{{- $src := "EMPTY" -}}
{{- if .IsNamedParams -}}
{{- $src = .Get "src" -}}
{{- else -}}
{{- $src = .Get 0 -}}
{{- end -}}
{{- $alignment := or (.Get "align") "center" -}}
<figure style="text-align: {{ $alignment }};">
{{ readFile (print "static" $src) | safeHTML }}
</figure>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment