layouts/partials/header.html (view raw)
1<head>
2 <meta charset="utf-8" />
3 <meta http-equiv="X-UA-Compatible" content="IE=edge">
4 {{- $title := ( .Title ) -}}
5 {{- $siteTitle := ( .Site.Title ) -}}
6 {{- if .IsHome -}}
7 <title>{{ $siteTitle }} {{ if isset .Site.Params "subtitle" }}- {{ .Site.Params.Subtitle }}{{ end }} </title>
8 {{- else -}}
9 <title>{{ $title }} - {{ $siteTitle }}</title>
10 {{- end -}}
11
12 {{- if isset .Site.Params "favicon" -}}
13 <link rel="icon" type="image/png" href={{ .Site.Params.favicon }} />
14 {{- end -}}
15
16 <meta name="viewport" content="width=device-width, initial-scale=1">
17 {{ with .OutputFormats.Get "rss" -}}
18 {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
19 {{ end -}}
20
21 {{- template "_internal/opengraph.html" . -}}
22 {{- template "_internal/twitter_cards.html" . -}}
23 {{ if and (isset .Site.Params "social") (isset .Site.Params "feathericonscdn") (eq .Site.Params.featherIconsCDN true) -}}
24 <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
25 {{- else if (isset .Site.Params "social") -}}
26 <script src="{{ .Site.BaseURL }}js/feather.min.js"></script>
27 {{ end }}
28 <link href="https://fonts.googleapis.com/css2?family=Fira+Sans&display=swap" rel="stylesheet">
29 <link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
30 <link rel="stylesheet" type="text/css" media="screen" href="{{ .Site.BaseURL }}css/main.css" />
31 {{- if or (eq .Site.Params.mode "auto") (eq .Site.Params.mode "dark") -}}
32 <link rel="stylesheet" type="text/css" href="{{ .Site.BaseURL }}css/dark.css" {{ if eq .Site.Params.mode "auto" }}media="(prefers-color-scheme: dark)"{{ end }} />
33 {{- end -}}
34 {{- range .Site.Params.customJS }}
35 {{- if or (hasPrefix . "http://") (hasPrefix . "https://") }}
36 <script src="{{ . }}"></script>
37 {{- else }}
38 <script src="{{ $.Site.BaseURL }}{{ . }}"></script>
39 {{- end }}
40 {{- end }}
41</head>