Skip to content

Commit

Permalink
fix: SVG header logo missing size (Lighthouse fix)
Browse files Browse the repository at this point in the history
Part 2/2.

See unresolved Hugo issue: gohugoio/hugo#3700

Workaround is to manually define SVG size:
site.Params.header.image.width
site.Params.header.image.height
  • Loading branch information
gcushen committed Sep 12, 2021
1 parent 0c28715 commit d054640
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wowchemy/layouts/partials/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
<div class="navbar-brand-mobile-wrapper d-inline-flex d-lg-none">
<a class="navbar-brand" href="{{ "/" | relLangURL }}">
{{- if $has_logo -}}
<img src="{{ $logo.RelPermalink }}" alt="{{ site.Title }}">
<img src="{{ $logo.RelPermalink }}" alt="{{ site.Title }}"
{{with site.Params.header.image.width}}width="{{.}}"{{end}}
{{with site.Params.header.image.height}}height="{{.}}"{{end}}>
{{- else -}}
{{- site.Title -}}
{{- end -}}
Expand Down

0 comments on commit d054640

Please sign in to comment.