mirror of
https://github.com/glanceapp/glance.git
synced 2025-06-21 18:31:24 +02:00
Add support for selfhst icons
This commit is contained in:
parent
24f9f20eb7
commit
f7062115bc
@ -193,8 +193,9 @@ func newCustomIconField(value string) customIconField {
|
|||||||
case "si":
|
case "si":
|
||||||
field.URL = "https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/" + icon + ".svg"
|
field.URL = "https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/" + icon + ".svg"
|
||||||
field.IsFlatIcon = true
|
field.IsFlatIcon = true
|
||||||
case "di":
|
case "di", "sh":
|
||||||
// syntax: di:<icon_name>[.svg|.png]
|
// syntax: di:<icon_name>[.svg|.png]
|
||||||
|
// syntax: sh:<icon_name>[.svg|.png]
|
||||||
// if the icon name is specified without extension, it is assumed to be wanting the SVG icon
|
// 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
|
// otherwise, specify the extension of either .svg or .png to use either of the CDN offerings
|
||||||
// any other extension will be interpreted as .svg
|
// any other extension will be interpreted as .svg
|
||||||
@ -208,7 +209,11 @@ func newCustomIconField(value string) customIconField {
|
|||||||
ext = "svg"
|
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:
|
default:
|
||||||
field.URL = value
|
field.URL = value
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user