made htmx logging a flag that can be toggled

This commit is contained in:
2026-01-24 16:55:36 +11:00
parent 038f8fd1a2
commit 3dc7cbe245
8 changed files with 50 additions and 14 deletions

View File

@@ -3,10 +3,12 @@ package layout
import "git.haelnorr.com/h/oslstats/internal/view/component/popup"
import "git.haelnorr.com/h/oslstats/internal/view/component/nav"
import "git.haelnorr.com/h/oslstats/internal/view/component/footer"
import "git.haelnorr.com/h/oslstats/pkg/contexts"
// Global page layout. Includes HTML document settings, header tags
// navbar and footer
templ Global(title string) {
{{ htmxLogging := contexts.HTMXLog(ctx) }}
<!DOCTYPE html>
<html
lang="en"
@@ -27,10 +29,11 @@ templ Global(title string) {
<script src="https://unpkg.com/htmx.org@2.0.4" integrity="sha384-HGfztofotfshcF7+8n44JQL2oJmowVChPTg48S+jvZoztPfvwD79OC/LTtG6dMp+" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/persist@3.x.x/dist/cdn.min.js"></script>
<script src="https://unpkg.com/alpinejs" defer></script>
<script>
// uncomment this line to enable logging of htmx events
// htmx.logAll();
</script>
if htmxLogging {
<script>
htmx.logAll();
</script>
}
<script>
const bodyData = {
showError500: false,