Skip to content

Commit

Permalink
Allow adding SVG in place of logo image (#976)
Browse files Browse the repository at this point in the history
Usage =>
Params.label.iconSVG: "<your SVG as a string>"
  • Loading branch information
icy-comet authored Jul 23, 2022
1 parent 87ffee9 commit 77ffb30
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assets/css/common/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
font-weight: 700;
}

.logo a img {
.logo a img, .logo a svg {
display: inline;
vertical-align: middle;
pointer-events: none;
Expand Down
2 changes: 2 additions & 0 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
<img src="{{- site.Params.label.icon | absURL -}}" alt="" aria-label="logo"
height="{{- site.Params.label.iconHeight | default "30" -}}">
{{- end -}}
{{- else if hasPrefix site.Params.label.iconSVG "<svg" }}
{{ site.Params.label.iconSVG | safeHTML }}
{{- end -}}
{{- $label_text -}}
</a>
Expand Down

0 comments on commit 77ffb30

Please sign in to comment.