From b5899af3c3cfe803e020796cee5eea449a7da6f3 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Sat, 21 Feb 2026 00:59:42 -0500 Subject: [PATCH] refactor(templates): consolidate header.js loading - Move header.js script from individual templates to header.templ - Removes duplicate script tags from bookshelf, collections, progress, etc. - Fixes indentation in docs.templ --- templates/bookshelf.templ | 1 - templates/collection_rules.templ | 1 - templates/collections.templ | 2 -- templates/docs.templ | 7 +++---- templates/header.templ | 1 + templates/progress.templ | 1 - templates/unlinked_books.templ | 1 - 7 files changed, 4 insertions(+), 10 deletions(-) diff --git a/templates/bookshelf.templ b/templates/bookshelf.templ index 282545a..e3a6123 100644 --- a/templates/bookshelf.templ +++ b/templates/bookshelf.templ @@ -9,7 +9,6 @@ templ BookShelf(user User, libraries []LibraryData) { Library - Bookhoard - diff --git a/templates/collection_rules.templ b/templates/collection_rules.templ index 75fe362..d6444a7 100644 --- a/templates/collection_rules.templ +++ b/templates/collection_rules.templ @@ -9,7 +9,6 @@ templ CollectionRules(user User, collection CollectionData) { Collection Rules - { collection.Name } - Bookhoard - diff --git a/templates/collections.templ b/templates/collections.templ index 125a53c..99c5009 100644 --- a/templates/collections.templ +++ b/templates/collections.templ @@ -11,7 +11,6 @@ templ Collection(user User, collections []CollectionData, errorMessage string) { Collections - Bookhoard - @@ -223,7 +222,6 @@ templ CollectionDetail(user User, collection CollectionData, books []handlers.Bo { collection.Name } - Bookhoard - diff --git a/templates/docs.templ b/templates/docs.templ index 740d185..855449b 100644 --- a/templates/docs.templ +++ b/templates/docs.templ @@ -13,10 +13,9 @@ templ DocsLayout(nav Navigation, doc Document, user User, currentPath string) { { doc.Title } - Bookhoard Documentation - - - - + + + @Header(user, currentPath) diff --git a/templates/header.templ b/templates/header.templ index 14d049e..3c969c1 100644 --- a/templates/header.templ +++ b/templates/header.templ @@ -163,4 +163,5 @@ templ Header(user User, currentPath string) { + } diff --git a/templates/progress.templ b/templates/progress.templ index 3a4eaf0..78ce53d 100644 --- a/templates/progress.templ +++ b/templates/progress.templ @@ -11,7 +11,6 @@ templ Progress(user User, progressData []handlers.ProgressWithMedia, errorMessag Reading Progress - Bookhoard - diff --git a/templates/unlinked_books.templ b/templates/unlinked_books.templ index 7eab2f2..3cf60b5 100644 --- a/templates/unlinked_books.templ +++ b/templates/unlinked_books.templ @@ -9,7 +9,6 @@ templ UnlinkedBooks(user User, unlinkedBooks []UnlinkedBookData) { Unlinked Books - Bookhoard -