2025-04-25 16:42:10 +08:00
|
|
|
<!DOCTYPE html>
|
2025-05-04 15:58:10 +08:00
|
|
|
<html>
|
|
|
|
|
<head>
|
2025-04-25 16:42:10 +08:00
|
|
|
<!-- Theme -->
|
|
|
|
|
<script>
|
|
|
|
|
function isDark() {
|
2025-05-06 17:30:23 +08:00
|
|
|
return localStorage.getItem('darkMode') === 'dark' || (!localStorage.getItem('darkMode') && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
2025-04-25 16:42:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isDark()) {
|
|
|
|
|
document.documentElement.classList.add('dark');
|
|
|
|
|
}
|
|
|
|
|
|
2025-05-06 17:30:23 +08:00
|
|
|
if (localStorage.getItem('themeVariant')) {
|
|
|
|
|
document.documentElement.classList.add(`theme-${localStorage.getItem('themeVariant')}`);
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-25 16:42:10 +08:00
|
|
|
document.addEventListener('alpine:init', () => {
|
2025-05-06 17:30:23 +08:00
|
|
|
Alpine.store('darkMode', {
|
2025-04-25 16:42:10 +08:00
|
|
|
isDark: isDark(),
|
|
|
|
|
toggle() {
|
|
|
|
|
this.isDark = document.documentElement.classList.toggle('dark');
|
2025-05-06 17:30:23 +08:00
|
|
|
localStorage.setItem('darkMode', this.isDark ? 'dark' : 'light');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Alpine.store('themeVariant', {
|
|
|
|
|
name: localStorage.getItem('themeVariant'),
|
|
|
|
|
setThemeVariant(name) {
|
|
|
|
|
this.name = name;
|
|
|
|
|
localStorage.setItem('themeVariant', name);
|
|
|
|
|
document.documentElement.classList.forEach(className => {
|
|
|
|
|
if (className.startsWith('theme-')) {
|
|
|
|
|
document.documentElement.classList.remove(className);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
document.documentElement.classList.add(`theme-${name}`);
|
2025-04-25 16:42:10 +08:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<meta charset="utf-8">
|
|
|
|
|
<meta http-equiv="Content-Language" content="en">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
|
|
|
|
|
|
<!-- Title & Description -->
|
|
|
|
|
<title>{{ site.title + ": " + title if page.url === "/" else title + " - " + site.title }}</title>
|
|
|
|
|
<meta name="description" content="{{ description or site.description }}"/>
|
|
|
|
|
<meta name="title" content="{{ title }} | Basecoat">
|
|
|
|
|
<meta name="description" content="{{ description }}">
|
|
|
|
|
|
|
|
|
|
<!-- Favicon -->
|
2025-05-06 20:39:14 +08:00
|
|
|
<link rel="icon" type="image/svg+xml" href="/assets/favicon.svg">
|
|
|
|
|
<link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png">
|
2025-04-25 16:42:10 +08:00
|
|
|
|
|
|
|
|
<!-- CSS -->
|
|
|
|
|
<link rel="preconnect" href="https://rsms.me/">
|
|
|
|
|
<link rel="stylesheet" href="https://rsms.me/inter/inter.css">
|
|
|
|
|
<link rel="stylesheet" href="/assets/styles.css">
|
|
|
|
|
|
|
|
|
|
<!-- JS -->
|
2025-05-01 20:53:03 +08:00
|
|
|
<script src="/assets/js/dialog.js" defer></script>
|
|
|
|
|
<script src="/assets/js/dropdown-menu.js" defer></script>
|
|
|
|
|
<script src="/assets/js/popover.js" defer></script>
|
|
|
|
|
<script src="/assets/js/select.js" defer></script>
|
2025-05-02 18:27:45 +08:00
|
|
|
<script src="/assets/js/sidebar.js" defer></script>
|
2025-05-01 20:53:03 +08:00
|
|
|
<script src="/assets/js/tabs.js" defer></script>
|
|
|
|
|
<script src="/assets/js/toast.js" defer></script>
|
|
|
|
|
<script>
|
|
|
|
|
document.addEventListener('alpine:init', () => {
|
|
|
|
|
window.basecoat.registerDialog(Alpine);
|
|
|
|
|
window.basecoat.registerDropdownMenu(Alpine);
|
|
|
|
|
window.basecoat.registerPopover(Alpine);
|
|
|
|
|
window.basecoat.registerSelect(Alpine);
|
2025-05-02 18:27:45 +08:00
|
|
|
window.basecoat.registerSidebar(Alpine);
|
2025-05-01 20:53:03 +08:00
|
|
|
window.basecoat.registerTabs(Alpine);
|
|
|
|
|
window.basecoat.registerToast(Alpine);
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
|
2025-04-25 16:42:10 +08:00
|
|
|
<script src="https://unpkg.com/htmx.org@2.0.4"></script>
|
2025-04-26 11:59:53 +08:00
|
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
|
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/django.min.js"></script>
|
|
|
|
|
<script>
|
|
|
|
|
const applyHighlighting = () => { if (window.hljs) hljs.highlightAll(); };
|
|
|
|
|
|
|
|
|
|
if (!window._hljsInitialized) {
|
|
|
|
|
window._hljsInitialized = true;
|
|
|
|
|
document.addEventListener('DOMContentLoaded', applyHighlighting);
|
|
|
|
|
document.addEventListener('htmx:afterSwap', applyHighlighting);
|
|
|
|
|
}
|
|
|
|
|
</script>
|
2025-04-27 23:19:52 +08:00
|
|
|
|
2025-04-26 11:59:53 +08:00
|
|
|
{% if head %}{{ head | safe }}{% endif %}
|
2025-04-25 16:42:10 +08:00
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
|
2025-05-04 15:58:10 +08:00
|
|
|
{% include "partials/sidebar.njk" %}
|
2025-05-02 18:27:45 +08:00
|
|
|
|
|
|
|
|
<main id="content">
|
2025-05-06 17:30:23 +08:00
|
|
|
<header class="bg-background sticky inset-x-0 top-0 isolate flex shrink-0 items-center gap-2 border-b z-10">
|
2025-05-04 15:58:10 +08:00
|
|
|
{% include "partials/header.njk" %}
|
2025-04-25 16:42:10 +08:00
|
|
|
</header>
|
|
|
|
|
|
2025-05-06 17:30:23 +08:00
|
|
|
<div class="p-6 md:p-8 xl:p-12">
|
2025-04-25 16:42:10 +08:00
|
|
|
{{ content | safe }}
|
|
|
|
|
</div>
|
|
|
|
|
</main>
|
2025-04-26 11:59:53 +08:00
|
|
|
|
2025-05-01 20:53:03 +08:00
|
|
|
{% from "toast.njk" import toaster %}
|
2025-04-25 16:42:10 +08:00
|
|
|
{{ toaster() }}
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|