refactor: add browseURL template helper for filter URLs

This commit is contained in:
2026-06-06 16:53:00 +02:00
parent 5441b14737
commit b9ca82dbd9
2 changed files with 171 additions and 1 deletions

View File

@@ -28,8 +28,9 @@ var Module = fx.Options(
func ProvideRenderer() (*Renderer, error) {
funcs := template.FuncMap{
"dict": dict,
"list": func(items ...string) []string { return items },
"list": func(items ...any) []any { return items },
"json": jsonAttr,
"browseURL": browseURL,
"genresParams": genresParams,
"hasGenre": hasGenre,
"add": func(a, b int) int { return a + b },
@@ -46,6 +47,7 @@ func ProvideRenderer() (*Renderer, error) {
"int": toInt,
"percent": percent,
"formatDate": formatDate,
"nextSort": nextSort,
"urlquery": url.QueryEscape,
}