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

@@ -24,6 +24,12 @@ type Lobsters struct {
func (widget *Lobsters) Initialize() error {
widget.withTitle("Lobsters").withCacheDuration(time.Hour)
if widget.InstanceURL == "" {
widget.withTitleURL("https://lobste.rs")
} else {
widget.withTitleURL(widget.InstanceURL)
}
if widget.SortBy == "" || (widget.SortBy != "hot" && widget.SortBy != "new") {
widget.SortBy = "hot"
}