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" } templ Collection(user User, collections []CollectionData, errorMessage string) {
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.
}by { book.Author }
}{ book.Title }