mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2023-12-21 10:22:58 +01:00
fix(layouts): remove resize on width
This commit is contained in:
parent
ba7161d728
commit
bb1b486822
@ -43,41 +43,60 @@
|
|||||||
<nav class="nav">
|
<nav class="nav">
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
{{- $label_text := (site.Params.label.text | default site.Title) }}
|
{{- $label_text := (site.Params.label.text | default site.Title) }}
|
||||||
|
|
||||||
{{- if site.Title }}
|
{{- if site.Title }}
|
||||||
<a href="{{ "" | absLangURL }}" accesskey="h" title="{{ $label_text }} (Alt + H)">
|
<a
|
||||||
{{- if site.Params.label.icon }}
|
accesskey="h"
|
||||||
{{- $img := resources.Get site.Params.label.icon }}
|
href="{{ "" | absLangURL }}"
|
||||||
{{- if $img }}
|
title="{{ $label_text }} (Alt + H)"
|
||||||
|
>
|
||||||
|
{{- if site.Params.label.icon -}}
|
||||||
|
{{- $img := resources.Get site.Params.label.icon -}}
|
||||||
|
|
||||||
|
{{- if $img -}}
|
||||||
{{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}}
|
{{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}}
|
||||||
|
|
||||||
{{- if hugo.IsExtended -}}
|
{{- if hugo.IsExtended -}}
|
||||||
{{- $processableFormats = $processableFormats | append "webp" -}}
|
{{- $processableFormats = $processableFormats | append "webp" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }}
|
|
||||||
{{- if and (in $processableFormats $img.MediaType.SubType) (eq $prod true)}}
|
{{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) -}}
|
||||||
{{- if (and (site.Params.label.iconHeight) (site.Params.label.iconWidth)) }}
|
|
||||||
{{- $img = $img.Resize (printf "%dx%d" site.Params.lable.iconWidth site.Params.label.iconHeight) }}
|
{{- if and (in $processableFormats $img.MediaType.SubType) (eq $prod true) -}}
|
||||||
{{- else if site.Params.label.iconHeight}}
|
{{- if site.Params.label.iconHeight -}}
|
||||||
{{- $img = $img.Resize (printf "x%d" site.Params.label.iconHeight) }}
|
{{- $img = $img.Resize (printf "x%s" site.Params.label.iconHeight) -}}
|
||||||
{{ else if site.Params.label.iconWidth }}
|
|
||||||
{{- $img = $img.Resize (printf "%dx" site.Params.label.iconWidth) }}
|
{{ else -}}
|
||||||
{{ else }}
|
{{- $img = $img.Resize "x30" -}}
|
||||||
{{- $img = $img.Resize "30x30" }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
<img src="{{ $img.Permalink }}" alt="" aria-label="logo"
|
|
||||||
height="{{- site.Params.label.iconHeight | default "30" -}}"
|
|
||||||
width="{{- site.Params.label.iconWidth | default "30" -}}">
|
|
||||||
{{- else }}
|
|
||||||
<img src="{{- site.Params.label.icon | absURL -}}" alt="" aria-label="logo"
|
|
||||||
height="{{- site.Params.label.iconHeight | default "30" -}}
|
|
||||||
width="{{- site.Params.label.iconWidth | default "30" -}}">
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
<img
|
||||||
|
alt=""
|
||||||
|
aria-label="logo"
|
||||||
|
src="{{ $img.Permalink }}"
|
||||||
|
width="{{- $img.Width | default "30" -}}"
|
||||||
|
height="{{- $img.Height | default "30" -}}"
|
||||||
|
>
|
||||||
|
|
||||||
|
{{- else }}
|
||||||
|
<img
|
||||||
|
alt=""
|
||||||
|
aria-label="logo"
|
||||||
|
src="{{- site.Params.label.icon | absURL -}}"
|
||||||
|
width="{{- site.Params.label.iconWidth | default "30" -}}"
|
||||||
|
height="{{- site.Params.label.iconHeight | default "30" -}}"
|
||||||
|
>
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{- else if hasPrefix site.Params.label.iconSVG "<svg" }}
|
{{- else if hasPrefix site.Params.label.iconSVG "<svg" }}
|
||||||
{{ site.Params.label.iconSVG | safeHTML }}
|
{{ site.Params.label.iconSVG | safeHTML }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- $label_text -}}
|
{{- $label_text -}}
|
||||||
</a>
|
</a>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
<div class="logo-switches">
|
<div class="logo-switches">
|
||||||
{{- if (not site.Params.disableThemeToggle) }}
|
{{- if (not site.Params.disableThemeToggle) }}
|
||||||
<button id="theme-toggle" accesskey="t" title="(Alt + T)">
|
<button id="theme-toggle" accesskey="t" title="(Alt + T)">
|
||||||
|
Loading…
Reference in New Issue
Block a user