Allow setting widget title URL

This commit is contained in:
Svilen Markov
2024-06-29 16:10:43 +01:00
parent 4dbb5975c0
commit 514cf2b81c
8 changed files with 36 additions and 5 deletions

View File

@@ -119,6 +119,7 @@ const (
type widgetBase struct {
Type string `yaml:"type"`
Title string `yaml:"title"`
TitleURL string `yaml:"title-url"`
CSSClass string `yaml:"css-class"`
CustomCacheDuration DurationField `yaml:"cache"`
ContentAvailable bool `yaml:"-"`
@@ -186,6 +187,14 @@ func (w *widgetBase) withTitle(title string) *widgetBase {
return w
}
func (w *widgetBase) withTitleURL(titleURL string) *widgetBase {
if w.TitleURL == "" {
w.TitleURL = titleURL
}
return w
}
func (w *widgetBase) withCacheDuration(duration time.Duration) *widgetBase {
w.cacheType = cacheTypeDuration