package templates import ( "fmt" "bookhoard/internal/handlers" ) // pluralizeBooks renders "book"/"books" for count displays. func pluralizeBooks(n int) string { if n == 1 { return "book" } return "books" } // CollectionBooksGrid renders the content of #books-container: the // collection's book cards, or the empty state. Shared by the collection // detail page and the /collections/:id/books-grid partial route (the // library switcher refreshes the grid through it — rendering ownership: // templ renders, JS only swaps). templ CollectionBooksGrid(collection CollectionData, books []handlers.BookInfo) { if len(books) == 0 {
by { book.Author }
}Organize your books into custom collections
Create collections to organize your books
{ col.Description }
{ fmt.Sprintf("%d %s", col.BookCount, pluralizeBooks(col.BookCount)) } if col.IsSmart { · rules-matched live }
{ collection.Description }
if collection.IsSmart {Membership is rules-matched live — always current, nothing to refresh.
}{ book.Title }