Allow adding SVG in place of logo image (#976)

Usage =>
Params.label.iconSVG: "<your SVG as a string>"
This commit is contained in:
Aniket Teredesai 2022-07-23 09:45:32 +05:30 committed by GitHub
parent 87ffee9fcf
commit 77ffb308c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -27,7 +27,7 @@
font-weight: 700; font-weight: 700;
} }
.logo a img { .logo a img, .logo a svg {
display: inline; display: inline;
vertical-align: middle; vertical-align: middle;
pointer-events: none; pointer-events: none;

View File

@ -66,6 +66,8 @@
<img src="{{- site.Params.label.icon | absURL -}}" alt="" aria-label="logo" <img src="{{- site.Params.label.icon | absURL -}}" alt="" 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 | safeHTML }}
{{- end -}} {{- end -}}
{{- $label_text -}} {{- $label_text -}}
</a> </a>