Skip to content

Commit

Permalink
Remove redundant code for Label.logo: resize image
Browse files Browse the repository at this point in the history
amend to 254b3e5
  • Loading branch information
adityatelange committed Mar 27, 2022
1 parent 254b3e5 commit 5a754bc
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,14 @@
{{- $processableFormats = $processableFormats | append "webp" -}}
{{- end -}}
{{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }}
{{- $imgUrl := "" }}
{{- if and (in $processableFormats $img.MediaType.SubType) (eq $prod true)}}
{{- if site.Params.label.iconHeight }}
{{- $img = $img.Resize (printf "x%d" site.Params.label.iconHeight) }}
{{ else }}
{{- $img = $img.Resize "x30" }}
{{- end }}
{{- $imgUrl = $img.Permalink }}
{{- else }}
{{- $imgUrl = site.Params.label.icon | absURL }}
{{- end }}
<img src="{{ $imgUrl }}" alt="logo" aria-label="logo"
<img src="{{ $img.Permalink }}" alt="logo" aria-label="logo"
height="{{- site.Params.label.iconHeight | default "30" -}}">
{{- else }}
<img src="{{- site.Params.label.icon | absURL -}}" alt="logo" aria-label="logo"
Expand Down

0 comments on commit 5a754bc

Please sign in to comment.