Browse Source

fix: SVG header logo missing size (Lighthouse fix)

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
George Cushen 3 years ago
parent
commit
d054640701
1 changed files with 3 additions and 1 deletions
  1. 3 1
      wowchemy/layouts/partials/navbar.html

+ 3 - 1
wowchemy/layouts/partials/navbar.html

@@ -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 -}}