From f7062115bc9cca1fb122ab528d6a5081b1b643cb Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Wed, 4 Dec 2024 08:11:18 +0000 Subject: [PATCH] Add support for selfhst icons --- internal/glance/config-fields.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/glance/config-fields.go b/internal/glance/config-fields.go index a757e73..fd90e2b 100644 --- a/internal/glance/config-fields.go +++ b/internal/glance/config-fields.go @@ -193,8 +193,9 @@ func newCustomIconField(value string) customIconField { case "si": field.URL = "https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/" + icon + ".svg" field.IsFlatIcon = true - case "di": + case "di", "sh": // syntax: di:[.svg|.png] + // syntax: sh:[.svg|.png] // if the icon name is specified without extension, it is assumed to be wanting the SVG icon // otherwise, specify the extension of either .svg or .png to use either of the CDN offerings // any other extension will be interpreted as .svg @@ -208,7 +209,11 @@ func newCustomIconField(value string) customIconField { ext = "svg" } - field.URL = "https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/" + ext + "/" + basename + "." + ext + if prefix == "di" { + field.URL = "https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/" + ext + "/" + basename + "." + ext + } else { + field.URL = "https://cdn.jsdelivr.net/gh/selfhst/icons@main/" + ext + "/" + basename + "." + ext + } default: field.URL = value }