hugo-theme-minima/layouts/partials/head.html

37 lines
1.6 KiB
HTML
Raw Normal View History

2021-07-18 10:34:01 +02:00
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{ template "_internal/opengraph.html" . }}
{{ template "_internal/twitter_cards.html" . }}
{{ template "_internal/google_analytics.html" . }}
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#262d33">
<title>
{{ if .IsHome }}
{{ .Site.Title }} {{ if .Site.Params.subtitle }} - {{ .Site.Params.subtitle }} {{ end }}
{{ else }}
{{ .Site.Title }} - {{ .Title }}
{{ end }}
</title>
{{ $favicon := "favicon.ico" }}
<link rel="shortcut icon" href="{{ $favicon | relURL }}" type="image/x-icon" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/normalize.css">
2021-07-18 12:54:56 +02:00
<link rel="stylesheet" type="text/css" media="screen" href="/css/main.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/css/md.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/css/syntax.css" />
<script src="/js/main.js"></script>
2021-07-18 10:34:01 +02:00
</head>
<script>
try {
if (!('theme' in localStorage)) {
localStorage.theme = window.matchMedia('(prefer-color-scheme: dark)').matches ? 'dark' : 'light';
}
document.querySelector('html').classList.add(localStorage.theme);
} catch (e) {
console.error(e);
}
</script>