You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
3.1 KiB
HTML
79 lines
3.1 KiB
HTML
5 years ago
|
{{define "base"}}
|
||
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
4 years ago
|
<title>{{ template "title" . }}</title>
|
||
5 years ago
|
|
||
3 years ago
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||
3 years ago
|
|
||
4 years ago
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css"
|
||
3 years ago
|
integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X" crossorigin="anonymous">
|
||
4 years ago
|
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js"
|
||
3 years ago
|
integrity="sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4"
|
||
|
crossorigin="anonymous"></script>
|
||
4 years ago
|
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js"
|
||
3 years ago
|
integrity="sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa"
|
||
|
crossorigin="anonymous"></script>
|
||
4 years ago
|
<script>
|
||
|
document.addEventListener("DOMContentLoaded", function () {
|
||
|
renderMathInElement(document.body, {
|
||
|
delimiters: [
|
||
|
{ left: "$", right: "$", display: false },
|
||
|
{ left: "$$", right: "$$", display: true },
|
||
|
{ left: "\\(", right: "\\)", display: false },
|
||
|
{ left: "\\[", right: "\\]", display: true }
|
||
|
]
|
||
|
});
|
||
|
});
|
||
3 years ago
|
|
||
|
document.addEventListener('DOMContentLoaded', () => {
|
||
|
const $toggle = document.querySelector('#toggle-dark-mode');
|
||
3 years ago
|
const $toggleIcon = document.querySelector('#toggle-dark-mode i');
|
||
3 years ago
|
|
||
3 years ago
|
// Loads prefered dark from from localStorage or defaults to media query.
|
||
|
let prefersDarkMode = localStorage.getItem('theme') !== undefined ? localStorage.getItem('theme') === 'dark' : window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||
3 years ago
|
|
||
3 years ago
|
function storePrefersDarkMode(mode) {
|
||
|
prefersDarkMode = mode;
|
||
|
localStorage.setItem('theme', mode ? 'dark' : 'light');
|
||
|
}
|
||
|
|
||
|
function displayToggle() {
|
||
|
document.body.classList.toggle('dark-mode', prefersDarkMode);
|
||
|
$toggleIcon.classList.toggle('fa-moon', prefersDarkMode);
|
||
|
$toggleIcon.classList.toggle('fa-sun', !prefersDarkMode);
|
||
|
}
|
||
|
|
||
|
$toggle.addEventListener('click', () => {
|
||
|
storePrefersDarkMode(!prefersDarkMode);
|
||
|
displayToggle();
|
||
|
});
|
||
|
|
||
|
displayToggle();
|
||
|
});
|
||
4 years ago
|
</script>
|
||
|
|
||
3 years ago
|
<link rel="stylesheet" href="/public/style.css">
|
||
|
<link rel="stylesheet" href="/public/theme-dark.css">
|
||
5 years ago
|
</head>
|
||
|
|
||
3 years ago
|
<body {{ if .Page.Name }}class="page-{{ .Page.Name }}"{{ end }}>
|
||
3 years ago
|
{{ template "navbar" . }}
|
||
5 years ago
|
|
||
3 years ago
|
<div class="main">
|
||
|
{{ template "body" . }}
|
||
|
</div>
|
||
4 years ago
|
|
||
5 years ago
|
<footer>
|
||
4 years ago
|
<div class="footer-item">
|
||
3 years ago
|
<a href="mailto:{{ .Config.Email }}">{{ .Config.Email }}</a>
|
||
4 years ago
|
</div>
|
||
5 years ago
|
</footer>
|
||
|
</body>
|
||
|
|
||
|
</html>
|
||
3 years ago
|
{{end}}
|