Allow fixed color

This commit is contained in:
Florian Hoss 2024-06-11 19:42:37 +02:00
parent efce5162da
commit 8ad7cc0fa4
No known key found for this signature in database
GPG key ID: 0638DC11BFD36662
3 changed files with 10 additions and 5 deletions

View file

@ -6,7 +6,7 @@ import (
templ Application(application services.Application) {
<a href={ templ.URL(application.URL) } class="flex items-center hover-effect">
<div class="w-8 h-8 dark:text-white fill-current">
<div class="w-8 h-8 dark:text-white fill-current flex items-center">
@templ.Raw(application.Icon)
</div>
<div class="uppercase truncate ml-2">{ application.Name }</div>

View file

@ -102,6 +102,10 @@ func (bs *BookmarkService) replaceIconString() {
continue
}
color, ok := iconsByTitle[bookmark.Name]
if bookmark.OverwriteColor != "" {
ok = true
color = bookmark.OverwriteColor
}
if !(bookmark.IgnoreColor || !ok || color == "") {
data = []byte(insertColor(string(data), color))
}

View file

@ -25,6 +25,7 @@ type Application struct {
Name string
Icon string
IgnoreColor bool `yaml:"ignore_color"`
OverwriteColor string `yaml:"overwrite_color"`
URL string
}