Send optional favicons only if provided

For instance always sending logo.svg link at the last position breaks
displaying favicon in Firefox if that file is missing (even if
previously precised png is available).
This commit is contained in:
Marcin Zajączkowski 2020-02-18 18:27:07 +01:00
parent 8575c09630
commit bcd07daf9b
1 changed files with 6 additions and 2 deletions

View File

@ -54,8 +54,12 @@
<meta name="msapplication-TileColor" content="#ffffff"> <meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png"> <meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
{{ else }} {{ else }}
{{ if (fileExists "static/apple-touch-icon.png") -}}
<link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | relURL }}"> <link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | relURL }}">
<link rel="shortcut icon" href="{{ "favicon.png" | relURL }}" type="image/x-icon"> {{- end }}
<link rel="shortcut icon" href="{{ "favicon.ico" | relURL }}" type="image/x-icon"> <link rel="shortcut icon" href="{{ "favicon.ico" | relURL }}" type="image/x-icon">
<link rel="icon" href="{{ "favicon.png" | relURL }}" sizes="any" type="image/png" />
{{ if (fileExists "static/logo.svg") -}}
<link rel="icon" href="{{ "logo.svg" | relURL }}" sizes="any" type="image/svg+xml" /> <link rel="icon" href="{{ "logo.svg" | relURL }}" sizes="any" type="image/svg+xml" />
{{ end }} {{- end }}
{{ end }}