Files
palina-theme/default.hbs
Sebastian Krüger b00f0559f0
All checks were successful
Deploy Theme / deploy (push) Successful in 15s
fix(mobile-menu): move state to root x-data and add .stop to all logo links
2026-02-19 21:13:24 +01:00

57 lines
2.0 KiB
Handlebars

<!DOCTYPE html>
<html lang="{{@site.lang}}"
x-data="{
theme: localStorage.getItem('theme') || (window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark'),
mobileMenuOpen: false,
init() {
$watch('theme', val => {
localStorage.setItem('theme', val);
document.documentElement.setAttribute('data-theme', val);
});
document.documentElement.setAttribute('data-theme', this.theme);
document.documentElement.classList.remove('hidden');
document.addEventListener('htmx:beforeRequest', () => {
this.mobileMenuOpen = false;
});
},
toggleMenu() {
this.mobileMenuOpen = !this.mobileMenuOpen;
}
}"
:data-theme="theme"
class="hidden">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{meta_title}}</title>
<link rel="stylesheet" href="{{asset "built/screen.css"}}">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap" rel="stylesheet">
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
<script src="https://unpkg.com/htmx.org@2.0.0"></script>
{{ghost_head}}
</head>
<body class="{{body_class}} font-sans antialiased">
{{!-- Mobile menu outside boosted area --}}
{{> mobile-menu}}
<div class="min-h-screen flex flex-col" hx-boost="true">
{{> header}}
<main class="flex-grow">
{{{body}}}
</main>
{{> footer}}
</div>
{{ghost_foot}}
<script src="{{asset "js/ghost-config.js"}}"></script>
<script src="{{asset "js/main.js"}}"></script>
</body>
</html>