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) { templ Application(application services.Application) {
<a href={ templ.URL(application.URL) } class="flex items-center hover-effect"> <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) @templ.Raw(application.Icon)
</div> </div>
<div class="uppercase truncate ml-2">{ application.Name }</div> <div class="uppercase truncate ml-2">{ application.Name }</div>

View file

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

View file

@ -22,10 +22,11 @@ type Link struct {
} }
type Application struct { type Application struct {
Name string Name string
Icon string Icon string
IgnoreColor bool `yaml:"ignore_color"` IgnoreColor bool `yaml:"ignore_color"`
URL string OverwriteColor string `yaml:"overwrite_color"`
URL string
} }
type SimpleIcons struct { type SimpleIcons struct {