package templates import ( "bookhoard/internal/services" "net/url" ) // Facet navigation helpers (faceted-navigation plan, Batch B). // // "Everything filterable should be clickable": every place a facet value // is DISPLAYED links to the bookshelf pre-filtered by that value. The // raw (stored) value rides the param — for genre that is the canonical // lowercase form, while the shown text is prettified — so matching and // display can never disagree. Series and tags keep their dedicated // pages (/series/detail, /tags/detail) by design and do NOT use these // helpers; author links predate them and stay as-is. // FacetLink renders a facet value as an inline text link (metadata // grid cells, the narrators line) to /bookshelf?_filter=. templ FacetLink(facet string, value string, display string) { { display } } // FacetBadge is the badge-styled FacetLink (the detail page's // age-rating and story-arc badges). templ FacetBadge(facet string, value string, display string) { { display } } // languageDisplay renders a stored language value for display: // "en" → "English"; unknown/legacy values pass through verbatim. func languageDisplay(value string) string { if name := services.LanguageDisplayName(value); name != "" { return name } return value }