77 lines
4.4 KiB
Plaintext
77 lines
4.4 KiB
Plaintext
<meta charset="utf-8">
|
|
<title>{% if title %}{{ title }} | {% endif %}{{ siteconfig.title }}</title>
|
|
{% if siteconfig.googleAnalytics %}
|
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
<script async src="https://www.googletagmanager.com/gtag/js?id={{ siteconfig.googleAnalytics }}"></script>
|
|
<script>
|
|
window.dataLayer = window.dataLayer || [];
|
|
function gtag(){dataLayer.push(arguments);}
|
|
gtag('js', new Date());
|
|
|
|
gtag('config', '{{ siteconfig.googleAnalytics }}');
|
|
</script>
|
|
{% endif %}
|
|
<script>
|
|
// Toggle dark/light mode, inline JS to avoid any theme flicker
|
|
function toggleDarkLightMode (isInit) {
|
|
// First time visitors
|
|
if (!("theme" in localStorage)) {
|
|
if (window.matchMedia("(prefers-color-scheme: light)").matches) {
|
|
document.querySelector("html").classList.remove("dark");
|
|
document.querySelector("html").classList.add("light");
|
|
localStorage.theme = "light";
|
|
} else {
|
|
localStorage.theme = "dark";
|
|
}
|
|
} else {
|
|
if (!isInit) {
|
|
if (localStorage.theme === "light") {
|
|
document.querySelector("html").classList.add("dark");
|
|
document.querySelector("html").classList.remove("light");
|
|
localStorage.theme = "dark";
|
|
} else if (localStorage.theme === "dark") {
|
|
document.querySelector("html").classList.add("light");
|
|
document.querySelector("html").classList.remove("dark");
|
|
localStorage.theme = "light";
|
|
}
|
|
} else {
|
|
if (localStorage.theme === "light") {
|
|
document.querySelector("html").classList.remove("dark");
|
|
document.querySelector("html").classList.add("light");
|
|
} else if (localStorage.theme === "dark") {
|
|
document.querySelector("html").classList.remove("light");
|
|
document.querySelector("html").classList.add("dark");
|
|
}
|
|
}
|
|
}
|
|
};
|
|
toggleDarkLightMode(true);
|
|
</script>
|
|
<link rel="apple-touch-icon" sizes="180x180" href="{{ '/assets/favicons/apple-touch-icon.png' | addHash }}">
|
|
<link rel="icon" type="image/png" sizes="32x32" href="{{ '/assets/favicons/favicon-32x32.png' | addHash }}">
|
|
<link rel="icon" type="image/png" sizes="16x16" href="{{ '/assets/favicons/favicon-16x16.png' | addHash }}">
|
|
<link rel="manifest" href="{{ '/assets/favicons/site.webmanifest' | addHash }}" crossorigin="use-credentials">
|
|
<link rel="mask-icon" href="{{ '/assets/favicons/safari-pinned-tab.svg' | addHash }}" color="#5bbad5">
|
|
<link rel="shortcut icon" href="{{ '/assets/favicons/favicon.ico' | addHash }}">
|
|
<link rel="canonical" href="{{ page.url | absoluteUrl }}" />
|
|
{% for name, item in meta %}
|
|
<meta name="{{ name }}" content="{{ item.value }}">
|
|
{% endfor %}
|
|
<meta name="msapplication-TileColor" content="#da532c">
|
|
<meta name="msapplication-config" content="{{ '/assets/favicons/browserconfig.xml' | addHash }}">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
{% set description = description | truncate(55) %}
|
|
<meta name="description" content="{% if description %}{{ description }}{% else %}{{ siteconfig.description }}{% endif %}">
|
|
<meta property="og:url" content="{{ page.url | absoluteUrl }}">
|
|
<meta property="og:type" content="website">
|
|
<meta property="og:title" content="{% if title %}{{ title }} | {% endif %}{{ siteconfig.title }}">
|
|
<meta property="og:description" content="{% if description %}{{ description }}{% else %}{{ siteconfig.description }}{% endif %}">
|
|
<meta property="og:image" content="{% if image %}{{ image | addHash | absoluteUrl }}{% else %}{{ siteconfig.openGraphDefaultImage | addHash | absoluteUrl }}{% endif %}">
|
|
<meta property="og:image:url" content="{% if image %}{{ image | addHash | absoluteUrl }}{% else %}{{ siteconfig.openGraphDefaultImage | addHash | absoluteUrl }}{% endif %}">
|
|
<meta name="twitter:image" content="{% if image %}{{ image | addHash | absoluteUrl }}{% else %}{{ siteconfig.openGraphDefaultImage | addHash | absoluteUrl }} {% endif %}">
|
|
<meta property="twitter:card" content="summary_large_image">
|
|
<meta property="twitter:site" content="{{ siteconfig.socialTwitter }}">
|
|
<script src="{{ '/assets/js/min.js' | addHash }}" type="module"></script>
|
|
<link rel="stylesheet" href="{{ '/assets/css/site-build.css' | addHash }}">
|
|
<script src="{{ '/assets/js/prism.js' | addHash }}"></script>
|
|
<link rel="stylesheet" href="{{ '/assets/css/prism-build.css' | addHash }}"> |