Only include links to favicons if the file exists

This commit is contained in:
Joe Hutchinson
2019-01-03 11:17:23 -05:00
parent 26e4dbfa7a
commit b7cc31a1be

View File

@@ -5,9 +5,13 @@
<title>{{ if ne .URL "/" }}{{ .Title }} &middot; {{ end }}{{ .Site.Title }}</title> <title>{{ if ne .URL "/" }}{{ .Title }} &middot; {{ end }}{{ .Site.Title }}</title>
<meta name="description" content="{{if .IsHome}}{{ $.Site.Params.description }}{{else}}{{.Description}}{{end}}" /> <meta name="description" content="{{if .IsHome}}{{ $.Site.Params.description }}{{else}}{{.Description}}{{end}}" />
<!-- Standard favicon --> <!-- Standard favicon -->
{{ if (fileExists "static/img/favicon.ico") -}}
<link rel="icon" type="image/x-icon" href="/img/favicon.ico"> <link rel="icon" type="image/x-icon" href="/img/favicon.ico">
{{- end }}
<!-- Recommended favicon format --> <!-- Recommended favicon format -->
{{ if (fileExists "static/img/favicon.png") -}}
<link rel="icon" type="image/png" href="/img/favicon.png"> <link rel="icon" type="image/png" href="/img/favicon.png">
{{- end }}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.0/normalize.min.css" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.0/normalize.min.css" />
<link rel="stylesheet" href="/css/style.css" /> <link rel="stylesheet" href="/css/style.css" />
<link rel="stylesheet" href="/css/xcode.css" /> <link rel="stylesheet" href="/css/xcode.css" />