templates: update script tags for ES modules and reader link

- Change script tags from 'defer' to 'type=module' for ES module support
- Add reader.js script to reader.templ for the reader bundle
- Update book_detail.templ 'Read Now' button to link to /readers/{id}
- Remove trailing blank line from register.templ
This commit is contained in:
2026-04-04 18:17:06 -04:00
parent 99d6c9a5d1
commit f1b1eebc0b
6 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ templ BookDetail(user User, book handlers.MediaDetail, errorMessage string) {
<div class="flex flex-wrap gap-3 mb-6">
<!-- Read Now (placeholder) -->
<button
@click="showReaderPlaceholder()"
@click={ "window.location.href = '/readers/" + uuidToString(book.ID) + "'" }
class="px-6 py-3 rounded-lg font-semibold"
style="background-color: var(--accent); color: white;"
>
+1 -1
View File
@@ -283,5 +283,5 @@ templ Header(user User, currentPath string) {
</div>
</div>
</nav>
<script src="/static/main.js" defer></script>
<script type="module" src="/static/main.js"></script>
}
+1 -1
View File
@@ -8,7 +8,7 @@ templ Index(loggedIn bool) {
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Bookhoard - Home</title>
<script src="/static/htmx.min.js"></script>
<script src="/static/main.js" defer></script>
<script type="module" src="/static/main.js"></script>
<link href="/static/style.css" rel="stylesheet"/>
</head>
<body class="theme-tokyo-night" x-data="index" x-init="initIndexTheme(); checkAuthRedirect()">
+1 -1
View File
@@ -8,7 +8,7 @@ templ Login(sessionExpired bool, deleted bool) {
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Login</title>
<script src="/static/htmx.min.js"></script>
<script src="/static/main.js" defer></script>
<script type="module" src="/static/main.js"></script>
<link href="/static/style.css" rel="stylesheet"/>
</head>
<body class="theme-tokyo-night min-h-screen" x-data="login" x-init="initLoginTheme()">
+1 -1
View File
@@ -12,7 +12,7 @@ templ Reader(user User, metadata ReaderMetadata, progress ReadingProgress, bookm
<link rel="manifest" href="/static/manifest.json"/>
<link href="/static/reader-fonts.css" rel="stylesheet"/>
<script src="/static/htmx.min.js"></script>
<script src="/static/main.js" defer></script>
<script type="module" src="/static/reader.js"></script>
<link href="/static/style.css" rel="stylesheet"/>
</head>
<body
+1 -2
View File
@@ -8,7 +8,7 @@ templ Register() {
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Register</title>
<script src="/static/htmx.min.js"></script>
<script src="/static/main.js" defer></script>
<script type="module" src="/static/main.js"></script>
<link href="/static/style.css" rel="stylesheet"/>
</head>
<body class="theme-tokyo-night min-h-screen" x-data="register" x-init="initRegisterTheme()">
@@ -74,4 +74,3 @@ templ Register() {
</body>
</html>
}