blog/src/templates/default.html

153 lines
4.8 KiB
HTML

<!doctype html>
<html lang="$lang$">
<head>
<title>$title$</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="$desc$" />
$if(author)$
<meta name="author" content="$author$" />
$endif$ $if(keywords)$
<meta name="keywords" content="$keywords$" />
$endif$
<meta property="og:site_name" content="$siteName$" />
<meta property="og:title" content="$title$" />
<meta property="og:url" content="$root$$url$" />
<meta property="og:description" content="$desc$" />
$if(image)$
<meta property="og:image" content="$root$$image$" />
$endif$ $if(type)$
<meta property="og:type" content="$type$" />
$else$
<meta property="og:type" content="website" />
$endif$ $if(image)$
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:image" content="$root$$image$" />
$endif$
<meta property="twitter:site" content="$siteName$" />
<meta property="twitter:title" content="$title$" />
<meta property="twitter:description" content="$desc$" />
$if(authorTwitter)$
<meta property="twitter:creator" content="$authorTwitter$" />
$endif$
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="canonical" href="$root$$url$" />
<link
rel="alternate"
href="./atom.xml"
title="$feedTitle$"
type="application/atom+xml"
/>
<link
rel="alternate"
href="./rss.xml"
title="$feedTitle$"
type="application/rss+xml"
/>
<link rel="stylesheet" href="./out/bundle.css" />
<link rel="stylesheet" href="./css/code.css" />
<script
async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js"
></script>
<script>
if (
localStorage.theme === "dark" ||
(!("theme" in localStorage) &&
window.matchMedia("(prefers-color-scheme: dark)").matches)
) {
document.documentElement.classList.add("dark")
} else {
document.documentElement.classList.remove("dark")
}
window.onload = () => {
var themeButton = document.getElementById("theme-toggle")
const theme = localStorage.getItem("theme")
if (theme === "light") {
themeButton.innerText = "theme: light"
} else if (theme === "dark") {
themeButton.innerText = "theme: dark"
} else {
themeButton.innerText = "theme: system"
}
}
MathJax = {
startup: {
ready: function () {
MathJax.startup.defaultReady()
MathJax.startup.promise.then(function () {
MathJax.mathml2svgPromise(document.body)
})
},
},
}
</script>
</head>
<body
class="container max-w-2xl mx-auto px-4 transition-colors duration-[2s]"
>
<header class="mt-14 md:mt-24 mb-14">
<div class="inline-flex items-center w-full">
<h1 class="text-4xl md:text-5xl font-serif font-medium">
<a
href="/"
class="dark:hover:text-muted-dark hover:text-muted-light transition-all duration-500 text-nowrap tracking-wide hover:tracking-wider"
>Gradient Ascent</a
>
</h1>
<div
class="w-full flex-grow flex-shrink rounded-lg h-1 bg-muted-light dark:bg-muted-dark mx-4"
></div>
</div>
<p class="mt-8 mb-3 px-1 italic">
writing about computers, math, hacks, games, and life.
</p>
<a class="text-sm external-link" href="https://youwen.dev"
>by Youwen Wu</a
>
<span class="ml-2 font-serif">|</span>
<button
id="theme-toggle"
class="ml-2 text-sm hover:bg-indigo-200 dark:hover:bg-violet-950 rounded-sm transition-colors p-1 duration-500"
></button>
</header>
$body$
<footer class="mt-14 md:mt-24 pb-12">
<hr
class="border-0 dark:bg-muted-dark bg-muted-light rounded-xl h-0.5 mb-4"
/>
<p class="text-sm leading-relaxed">
&copy; 2024 Youwen Wu. Generated by
<a
href="https://jaspervdj.be/hakyll/"
class="external-link"
target="__blank"
>Hakyll.</a
>
View the source
<a
href="https://github.com/couscousdude/blog"
class="external-link"
target="__blank"
>on GitHub.</a
>
</p>
<p class="text-sm leading-relaxed mt-2">
Content freely available under
<a
class="external-link"
target="__blank"
href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en"
><span class="smallcaps">CC BY-NC-SA</span> 4.0</a
>
unless otherwise noted.
</p>
</footer>
<script defer src="./out/bundle.js"></script>
</body>
</html>