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:
@@ -10,7 +10,7 @@ templ Collection(user User, collections []CollectionData, errorMessage string) {
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>Collections - 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 x-data="collections" class="theme-{ user.Theme }">
|
||||
@@ -109,7 +109,7 @@ templ CollectionDetail(user User, collection CollectionData, books []handlers.Bo
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>{ collection.Name } - 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 x-data="collections" class="theme-{ user.Theme }">
|
||||
|
||||
Reference in New Issue
Block a user