perf(templates): add defer attribute to main.js script tags

- Add defer attribute to all main.js script includes across 22 template files
- Improves page load performance by allowing HTML parsing to continue without blocking
- Maintains script execution order while enabling parallel resource loading

This optimization reduces page render blocking and improves perceived load times
across all admin and user-facing pages that include the main.js bundle.

Affected pages include: admin dashboard, library management, settings, user
management, analytics, bookshelf, collections, conflicts, custom sections,
devices, documentation, profile, progress tracking, queue, and authentication
pages (login/register).
This commit is contained in:
2026-03-12 09:04:13 -04:00
parent b754f0ddce
commit 96e206b671
21 changed files with 24 additions and 24 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ templ AdminSettings(user User, systemConfig map[string]string, errorMessage stri
<meta charset="UTF-8"/>
<title>System Settings - Bookhoard</title>
<script src="/static/htmx.min.js"></script>
<script src="/static/main.js"></script>
<script src="/static/main.js" defer></script>
<link href="/static/style.css" rel="stylesheet"/>
</head>
<body class="theme-{ user.Theme }" x-data="adminSettings">