From 90254b92d2d2dc1e2d2e1305c0e1096bbfdeda80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=ADtalo=20Silva?= Date: Sat, 12 Apr 2025 19:48:09 -0300 Subject: [PATCH] Support embed icons on bookmarks URLs --- internal/glance/templates.go | 2 ++ internal/glance/templates/bookmarks.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/glance/templates.go b/internal/glance/templates.go index 699772d..8164eb0 100644 --- a/internal/glance/templates.go +++ b/internal/glance/templates.go @@ -5,6 +5,7 @@ import ( "html/template" "math" "strconv" + "strings" "golang.org/x/text/language" "golang.org/x/text/message" @@ -53,6 +54,7 @@ var globalTemplateFunctions = template.FuncMap{ return template.HTML(value + ` ` + label + ``) }, + "hasPrefix": strings.HasPrefix, } func mustParseTemplate(primary string, dependencies ...string) *template.Template { diff --git a/internal/glance/templates/bookmarks.html b/internal/glance/templates/bookmarks.html index 1952cdb..1db21c0 100644 --- a/internal/glance/templates/bookmarks.html +++ b/internal/glance/templates/bookmarks.html @@ -13,7 +13,7 @@
{{- if ne "" .Icon.URL }}
- +
{{- end }} {{ .Title }}