2018-01-08 17:28:39 +01:00
|
|
|
<!DOCTYPE html>
|
2021-08-20 13:21:20 +02:00
|
|
|
<html lang="{{ site.LanguageCode }}">
|
2019-03-31 14:32:06 +02:00
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
2021-08-20 13:21:20 +02:00
|
|
|
|
2019-03-31 14:32:06 +02:00
|
|
|
<!-- Title -->
|
2021-08-20 13:21:20 +02:00
|
|
|
<title>{{ if not .IsHome }}{{ .Title }} - {{ end }}{{ site.Title }}</title>
|
|
|
|
|
2019-03-31 14:32:06 +02:00
|
|
|
<!-- Meta -->
|
2021-08-20 13:21:20 +02:00
|
|
|
{{ if eq .Kind "page" }}
|
2019-03-31 14:32:06 +02:00
|
|
|
<meta name="description" content="{{ .Summary }}">
|
2021-08-20 13:21:20 +02:00
|
|
|
<meta name="author" content="{{ .Params.Author | default site.Author.name }}">
|
|
|
|
{{ else }}
|
|
|
|
<meta name="description" content="{{ site.Params.description }}">
|
|
|
|
<meta name="author" content="{{ site.Author.name }}">
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
<!-- Styles & Scripts -->
|
|
|
|
{{ $app_css := resources.Get "app.css" }}
|
|
|
|
{{ $custom_css := resources.Get "custom.css" }}
|
|
|
|
{{ $css := slice $app_css $custom_css | resources.Concat "app.css" | minify }}
|
|
|
|
<link rel="preload stylesheet" as="style" href="{{ $css.Permalink }}">
|
|
|
|
|
|
|
|
{{ if and .IsPage (not site.Params.disableHLJS) }}
|
|
|
|
<link rel="preload stylesheet" as="style" href="{{ `an-old-hope.min.css` | absURL }}">
|
|
|
|
<script defer src="{{ `highlight.min.js` | absURL }}" onload="hljs.initHighlightingOnLoad();"></script>
|
|
|
|
{{ end }}
|
|
|
|
|
2021-08-22 02:23:24 +02:00
|
|
|
<!-- Preload -->
|
|
|
|
<link rel="preload" as="image" href="{{ `theme.png` | absURL }}">
|
2021-08-22 02:36:17 +02:00
|
|
|
{{ if site.Params.twitter }}
|
|
|
|
<link rel="preload" as="image" href="{{ `twitter.svg` | absURL }}">
|
|
|
|
{{ end }}
|
|
|
|
{{ if site.Params.github }}
|
|
|
|
<link rel="preload" as="image" href="{{ `github.svg` | absURL }}">
|
|
|
|
{{ end }}
|
|
|
|
{{ if site.Params.instagram }}
|
|
|
|
<link rel="preload" as="image" href="{{ `instagram.svg` | absURL }}">
|
|
|
|
{{ end }}
|
2021-08-22 02:23:24 +02:00
|
|
|
|
2021-08-22 02:36:17 +02:00
|
|
|
<!-- Favicon -->
|
2021-08-20 13:21:20 +02:00
|
|
|
<link rel="icon" href="{{ `favicon.ico` | absURL }}">
|
|
|
|
<link rel="apple-touch-icon" href="{{ `apple-touch-icon.png` | absURL }}">
|
|
|
|
|
2019-03-31 14:32:06 +02:00
|
|
|
<!-- Generator -->
|
2021-08-20 13:21:20 +02:00
|
|
|
{{ hugo.Generator }}
|
|
|
|
|
2019-03-31 14:32:06 +02:00
|
|
|
<!-- RSS -->
|
2021-08-20 13:21:20 +02:00
|
|
|
{{ range .AlternativeOutputFormats }}
|
|
|
|
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink }}" title="{{ site.Title }}">
|
|
|
|
{{ end }}
|
|
|
|
|
2019-06-10 21:29:55 +02:00
|
|
|
<!-- Misc -->
|
2021-08-20 13:21:20 +02:00
|
|
|
{{ if hugo.IsProduction | eq site.Params.env "production" }}
|
|
|
|
{{ template "_internal/google_analytics_async.html" . }}
|
|
|
|
{{ template "_internal/google_news.html" . }}
|
|
|
|
{{ template "_internal/opengraph.html" . }}
|
|
|
|
{{ template "_internal/schema.html" . }}
|
|
|
|
{{ template "_internal/twitter_cards.html" . }}
|
|
|
|
{{ end }}
|
2019-03-31 14:32:06 +02:00
|
|
|
</head>
|
2021-08-20 13:21:20 +02:00
|
|
|
|
|
|
|
<body class="not-ready" data-menu="{{ isset site.Menus `main` }}">
|
2019-03-31 14:32:06 +02:00
|
|
|
<header class="header">
|
2021-08-20 13:21:20 +02:00
|
|
|
{{ $tag := cond .IsHome "h1" "p" }}
|
|
|
|
{{ printf `
|
|
|
|
<%s class="logo">
|
|
|
|
<a class="site-name" href="%s">%s</a>
|
|
|
|
<a class="btn-theme"></a>
|
|
|
|
</%s>
|
|
|
|
` $tag ("" | absURL) site.Title $tag | safeHTML }}
|
|
|
|
|
|
|
|
<script>
|
2021-08-20 22:22:56 +02:00
|
|
|
let bodyClass = document.body.classList;
|
|
|
|
let schemeDark = window.matchMedia('(prefers-color-scheme: dark)');
|
|
|
|
let buttonDark = document.querySelector('.btn-theme');
|
2021-08-20 13:21:20 +02:00
|
|
|
|
2021-08-20 22:22:56 +02:00
|
|
|
let setDark = () => {
|
2021-08-20 13:21:20 +02:00
|
|
|
bodyClass.add('dark');
|
|
|
|
localStorage.setItem('dark', 'true');
|
|
|
|
};
|
|
|
|
|
2021-08-20 22:22:56 +02:00
|
|
|
let setLight = () => {
|
2021-08-20 13:21:20 +02:00
|
|
|
bodyClass.remove('dark');
|
|
|
|
localStorage.removeItem('dark');
|
|
|
|
};
|
|
|
|
|
|
|
|
if (schemeDark.matches || localStorage.getItem('dark')) setDark();
|
|
|
|
|
|
|
|
requestAnimationFrame(() => {
|
|
|
|
bodyClass.remove('not-ready');
|
|
|
|
});
|
|
|
|
|
|
|
|
schemeDark.addEventListener('change', event => {
|
|
|
|
event.matches ? setDark() : setLight();
|
|
|
|
});
|
|
|
|
|
|
|
|
buttonDark.addEventListener('click', () => {
|
|
|
|
bodyClass.contains('dark') ? setLight() : setDark();
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
{{ if site.Menus.main }}
|
|
|
|
<nav class="menu">
|
2021-08-20 22:18:07 +02:00
|
|
|
{{ $url := .Permalink }}
|
2021-08-20 13:21:20 +02:00
|
|
|
{{ range site.Menus.main }}
|
2021-08-20 22:05:36 +02:00
|
|
|
<a class="{{ if eq $url .URL }}active{{ end }}" href="{{ .URL }}">{{ .Name }}</a>
|
2021-08-20 13:21:20 +02:00
|
|
|
{{ end }}
|
2019-08-19 22:12:49 +02:00
|
|
|
</nav>
|
2021-08-20 13:21:20 +02:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ if site.Params.twitter }}
|
|
|
|
<a class="social-icon twitter" href="https://twitter.com/{{ site.Params.twitter }}" target="_blank"></a>
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ if site.Params.github }}
|
|
|
|
<a class="social-icon github" href="https://github.com/{{ site.Params.github }}" target="_blank"></a>
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ if site.Params.instagram }}
|
|
|
|
<a class="social-icon instagram" href="https://www.instagram.com/{{ site.Params.instagram }}/" target="_blank"></a>
|
|
|
|
{{ end }}
|
|
|
|
|
2019-03-31 14:32:06 +02:00
|
|
|
</header>
|
|
|
|
<main class="main">
|