add label.iconSVG key

This commit is contained in:
Aniket Teredesai 2022-07-11 14:40:02 +05:30
parent c0b7ea5f4b
commit 3b81ff905b

View File

@ -66,6 +66,8 @@
<img src="{{- site.Params.label.icon | absURL -}}" alt="logo" aria-label="logo" <img src="{{- site.Params.label.icon | absURL -}}" alt="logo" aria-label="logo"
height="{{- site.Params.label.iconHeight | default "30" -}}"> height="{{- site.Params.label.iconHeight | default "30" -}}">
{{- end -}} {{- end -}}
{{- else if hasPrefix site.Params.label.iconSVG "<svg" }}
{{ site.Params.label.iconSVG | replaceRE `\s*height\s*=\s*"[\w\s]*"|\s*width\s*=\s*"[\w\s]*"` "" | replaceRE "^<svg" (printf `<svg height="%d"` site.Params.label.iconHeight) | safeHTML }}
{{- end -}} {{- end -}}
{{- $label_text -}} {{- $label_text -}}
</a> </a>