check if favicon file exists

This commit is contained in:
Nishant Srivastava 2019-12-30 13:05:11 +01:00
parent 66aba35846
commit 384513f6ea
1 changed files with 7 additions and 2 deletions

View File

@ -17,8 +17,13 @@
<meta name="theme-color" content="{{ $.Param "themecolor" | default "#ffffff" }}"> <meta name="theme-color" content="{{ $.Param "themecolor" | default "#ffffff" }}">
<link rel="canonical" href="{{ .Permalink }}"> <link rel="canonical" href="{{ .Permalink }}">
<link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | relURL }}"> <link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | relURL }}">
{{ if (fileExists "static/images/favicon.png") }}
<link rel="shortcut icon" href="{{ "images/favicon.png" | relURL }}" type="image/x-icon"> <link rel="shortcut icon" href="{{ "images/favicon.png" | relURL }}" type="image/x-icon">
{{ else if (fileExists "static/images/favicon.ico") }}
<link rel="shortcut icon" href="{{ "images/favicon.ico" | relURL }}" type="image/x-icon"> <link rel="shortcut icon" href="{{ "images/favicon.ico" | relURL }}" type="image/x-icon">
{{ end }}
<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" />
<link rel="manifest" href="{{ "manifest.json" | relURL }}"> <link rel="manifest" href="{{ "manifest.json" | relURL }}">