refactor(alpine): migrate remaining pages to x-init declarative initialization

- Remove DOMContentLoaded event listeners from analytics.ts and docs.ts
- Rely on x-init attribute in templates for page initialization
- Clean up unused exports from collections.ts Alpine data
- Add x-init calls to admin_library, analytics, and docs templates
- Normalize quote style in collections WebSocket script (single to double)
- Disable Add Books button in collection detail (pending implementation)
This commit is contained in:
2026-03-12 18:13:12 -04:00
parent 75c454b661
commit 06461a3202
11 changed files with 58 additions and 88 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ templ DocsLayout(nav Navigation, doc Document, user User, currentPath string) {
<link rel="stylesheet" href="/static/highlight-dark.min.css"/>
<script src="/static/main.js" defer></script>
</head>
<body class={ "theme-" + user.Theme + " page-docs bg-background-primary text-text-primary font-sans antialiased" }>
<body x-data="docs" x-init="initializeSearch" class={ "theme-" + user.Theme + " page-docs bg-background-primary text-text-primary font-sans antialiased" }>
@Header(user, currentPath)
<!-- Mobile Menu Button -->
<button