mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-30 11:13:06 +00:00
favicon: indention #549
This commit is contained in:
parent
b705e0bde4
commit
cba1d38595
1 changed files with 30 additions and 30 deletions
|
@ -5,42 +5,42 @@
|
||||||
{{- $ico := dict "ext" "ico" "type" "image/x-icon" }}
|
{{- $ico := dict "ext" "ico" "type" "image/x-icon" }}
|
||||||
{{- $faviconTypes := slice $svg $png $ico }}
|
{{- $faviconTypes := slice $svg $png $ico }}
|
||||||
{{- range $faviconTypes }}
|
{{- range $faviconTypes }}
|
||||||
{{- if and
|
{{- if and
|
||||||
(eq $faviconMatch false)
|
(eq $faviconMatch false)
|
||||||
(or
|
(or
|
||||||
(fileExists (printf "/static/images/favicon-light.%s" .ext))
|
(fileExists (printf "/static/images/favicon-light.%s" .ext))
|
||||||
(fileExists (printf "/static/images/favicon-dark.%s"))
|
(fileExists (printf "/static/images/favicon-dark.%s"))
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
{{- $faviconMatch = true }}
|
{{- $faviconMatch = true }}
|
||||||
{{/*
|
{{$c:=""}}{{/*
|
||||||
Warning: IE and old browser versions do not support media queries necessary for the light & dark theme option.
|
Warning: IE and old browser versions do not support media queries necessary for the light & dark theme option.
|
||||||
If you have requirements to support IE and/or older browser versions, use one of the other options.
|
If you have requirements to support IE and/or older browser versions, use one of the other options.
|
||||||
Reference: https://caniuse.com/css-media-interaction
|
Reference: https://caniuse.com/css-media-interaction
|
||||||
*/}}
|
*/}}
|
||||||
{{- if (fileExists (printf "/static/images/favicon-light.%s" .ext)) }}
|
{{- if (fileExists (printf "/static/images/favicon-light.%s" .ext)) }}
|
||||||
<link href="{{ printf "images/favicon-light.%s" .ext | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="icon" type="{{ .type }}" media="(prefers-color-scheme: light)">
|
<link href="{{ printf "images/favicon-light.%s" .ext | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="icon" type="{{ .type }}" media="(prefers-color-scheme: light)">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if (fileExists (printf "/static/images/favicon-dark.%s" .ext)) }}
|
{{- if (fileExists (printf "/static/images/favicon-dark.%s" .ext)) }}
|
||||||
<link href="{{ printf "images/favicon-dark.%s" .ext | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="icon" type="{{ .type }}" media="(prefers-color-scheme: dark)">
|
<link href="{{ printf "images/favicon-dark.%s" .ext | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="icon" type="{{ .type }}" media="(prefers-color-scheme: dark)">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- range $faviconTypes }}
|
{{- range $faviconTypes }}
|
||||||
{{- if and
|
{{- if and
|
||||||
(eq $faviconMatch false)
|
(eq $faviconMatch false)
|
||||||
(fileExists (printf "/static/images/favicon.%s" .ext))
|
(fileExists (printf "/static/images/favicon.%s" .ext))
|
||||||
}}
|
}}
|
||||||
{{- $faviconMatch = true }}
|
{{- $faviconMatch = true }}
|
||||||
<link href="{{ printf "images/favicon.%s" .ext | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="icon" type="{{ .type }}">
|
<link href="{{ printf "images/favicon.%s" .ext | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="icon" type="{{ .type }}">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- range $faviconTypes }}
|
{{- range $faviconTypes }}
|
||||||
{{- if and
|
{{- if and
|
||||||
(eq $faviconMatch false)
|
(eq $faviconMatch false)
|
||||||
(fileExists (printf "/static/images/logo.%s" .ext))
|
(fileExists (printf "/static/images/logo.%s" .ext))
|
||||||
}}
|
}}
|
||||||
{{- $faviconMatch := true }}
|
{{- $faviconMatch := true }}
|
||||||
<link href="{{ printf "images/logo.%s" .ext | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="icon" type="{{ .type }}">
|
<link href="{{ printf "images/logo.%s" .ext | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="icon" type="{{ .type }}">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
Loading…
Reference in a new issue