edited post

This commit is contained in:
Morgan 2023-10-29 11:50:46 +09:00
parent c5f9dff099
commit afb9d2f7cb
3 changed files with 3 additions and 19 deletions

View File

@ -73,7 +73,8 @@ params:
safari_pinned_tab: "https://blog.morgan.kr/favicon.ico" safari_pinned_tab: "https://blog.morgan.kr/favicon.ico"
label: label:
icon: /favicon.ico icon: /favicon.png
icon_dark: /favicon-ing.png
iconHeight: 24 iconHeight: 24
analytics: analytics:

BIN
static/favicon-inv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

@ -5,25 +5,8 @@
{{- if site.Title }} {{- if site.Title }}
<a href="{{ "" | absLangURL }}" accesskey="h" title="{{ $label_text }}"> <a href="{{ "" | absLangURL }}" accesskey="h" title="{{ $label_text }}">
{{- if site.Params.label.icon }} {{- if site.Params.label.icon }}
{{- $img := resources.Get site.Params.label.icon }}
{{- if $img }}
{{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}}
{{- if hugo.IsExtended -}}
{{- $processableFormats = $processableFormats | append "webp" -}}
{{- end -}}
{{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }}
{{- 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 }}
{{- end }}
<img src="{{ $img.Permalink }}" alt="" aria-label="logo"
height="{{- site.Params.label.iconHeight | default "30" -}}">
{{- else }}
<img src="{{- site.Params.label.icon | absURL -}}" alt="" aria-label="logo" <img src="{{- site.Params.label.icon | absURL -}}" alt="" aria-label="logo"
height="{{- site.Params.label.iconHeight | default "30" -}}"> height="{{- site.Params.label.iconHeight | default "24" -}}">
{{- end -}} {{- end -}}
{{- else }} {{- else }}
{{- $label_text -}} {{- $label_text -}}