Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,7 @@ An array of RSS/atom feeds. The title can optionally be changed.
| title | string | no | the title provided by the feed | |
| hide-categories | boolean | no | false | Only applicable for `detailed-list` style |
| hide-description | boolean | no | false | Only applicable for `detailed-list` style |
| hide-thumbnail | boolean | no | false | Only applicable for `detailed-list` style |
| limit | integer | no | | |
| item-link-prefix | string | no | | |
| headers | key (string) & value (string) | no | | |
Expand Down
2 changes: 2 additions & 0 deletions internal/glance/templates/rss-detailed-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<ul class="list list-gap-24 collapsible-container" data-collapse-after="{{ .CollapseAfter }}">
{{ range .Items }}
<li class="flex gap-15 items-start row-reverse-on-mobile thumbnail-parent">
{{ if eq false .HideThumbnail }}
<div class="thumbnail-container rss-detailed-thumbnail">
{{ if ne "" .ImageURL }}
<img class="thumbnail" loading="lazy" src="{{ .ImageURL }}" alt="">
Expand All @@ -13,6 +14,7 @@
</svg>
{{ end }}
</div>
{{ end }}
<div class="grow min-width-0">
<a class="size-h3 color-primary-if-not-visited" href="{{ .Link }}" target="_blank" rel="noreferrer">{{ .Title }}</a>
<ul class="list-horizontal-text flex-nowrap">
Expand Down
22 changes: 14 additions & 8 deletions internal/glance/widget-rss.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,15 @@ type cachedRSSFeed struct {
}

type rssFeedItem struct {
ChannelName string
ChannelURL string
Title string
Link string
ImageURL string
Categories []string
Description string
PublishedAt time.Time
ChannelName string
ChannelURL string
Title string
Link string
ImageURL string
Categories []string
Description string
PublishedAt time.Time
HideThumbnail bool
}

func (i rssFeedItem) filterableField(field string) any {
Expand All @@ -158,6 +159,7 @@ type rssFeedRequest struct {
Title string `yaml:"title"`
HideCategories bool `yaml:"hide-categories"`
HideDescription bool `yaml:"hide-description"`
HideThumbnail bool `yaml:"hide-thumbnail"`
Limit int `yaml:"limit"`
ItemLinkPrefix string `yaml:"item-link-prefix"`
ThumbnailLinkPrefix string `yaml:"thumbnail-link-prefix"`
Expand Down Expand Up @@ -327,6 +329,10 @@ func (widget *rssWidget) fetchItemsFromFeedTask(request rssFeedRequest) ([]rssFe

rssItem.Categories = categories
}

if request.HideThumbnail {
rssItem.HideThumbnail = true
}
}

if request.Title != "" {
Expand Down