mirror of
https://github.com/Xevion/glance.git
synced 2025-12-10 02:07:20 -06:00
Add grid-cards style for videos widget
This commit is contained in:
@@ -13,6 +13,7 @@ type Videos struct {
|
||||
widgetBase `yaml:",inline"`
|
||||
Videos feed.Videos `yaml:"-"`
|
||||
VideoUrlTemplate string `yaml:"video-url-template"`
|
||||
Style string `yaml:"style"`
|
||||
Channels []string `yaml:"channels"`
|
||||
Limit int `yaml:"limit"`
|
||||
}
|
||||
@@ -42,5 +43,9 @@ func (widget *Videos) Update(ctx context.Context) {
|
||||
}
|
||||
|
||||
func (widget *Videos) Render() template.HTML {
|
||||
if widget.Style == "grid-cards" {
|
||||
return widget.render(widget, assets.VideosGridTemplate)
|
||||
}
|
||||
|
||||
return widget.render(widget, assets.VideosTemplate)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user