fix(htmx): move hx-boost to body to capture mobile menu navigation
All checks were successful
Deploy Theme / deploy (push) Successful in 13s

This commit is contained in:
2026-02-20 11:17:21 +01:00
parent 0c477ca428
commit 881b357167

View File

@@ -34,16 +34,19 @@
{{ghost_head}} {{ghost_head}}
</head> </head>
<body <body
class="{{body_class}} font-sans antialiased"> class="{{body_class}} font-sans antialiased"
hx-boost="true"
hx-target="#viewport"
hx-select="#viewport"
>
{{!-- The Mobile Menu is outside the swap target and stays alive --}} {{!-- The Mobile Menu is outside the swap target and stays alive --}}
{{> mobile-menu}} {{> mobile-menu}}
{{!-- {{!--
We target only this container for HTMX page swaps. This container is the target for HTMX swaps.
This keeps root Alpine state (like mobileMenuOpen) persistent.
--}} --}}
<div id="viewport" class="min-h-screen flex flex-col" hx-boost="true" hx-target="#viewport" hx-select="#viewport"> <div id="viewport" class="min-h-screen flex flex-col">
{{> header}} {{> header}}
<main class="flex-grow"> <main class="flex-grow">