mirror of
https://github.com/glanceapp/glance.git
synced 2024-11-24 09:24:13 +01:00
Add single-line-titles property to RSS widget
This commit is contained in:
parent
776fdcc6ce
commit
bbda9a0ee8
@ -472,10 +472,18 @@ Example:
|
|||||||
| thumbnail-height | float | no | 10 |
|
| thumbnail-height | float | no | 10 |
|
||||||
| card-height | float | no | 27 |
|
| card-height | float | no | 27 |
|
||||||
| limit | integer | no | 25 |
|
| limit | integer | no | 25 |
|
||||||
|
| single-line-titles | boolean | no | false |
|
||||||
| collapse-after | integer | no | 5 |
|
| collapse-after | integer | no | 5 |
|
||||||
|
|
||||||
##### `style`
|
##### `style`
|
||||||
Used to change the appearance of the widget. Possible values are `vertical-list` and `horizontal-cards` where the former is intended to be used within a small column and the latter a full column. Below are previews of each style.
|
Used to change the appearance of the widget. Possible values are:
|
||||||
|
|
||||||
|
* `vertical-list` - suitable for `full` and `small` columns
|
||||||
|
* `detailed-list` - suitable for `full` columns
|
||||||
|
* `horizontal-cards` - suitable for `full` columns
|
||||||
|
* `horizontal-cards-2` - suitable for `full` columns
|
||||||
|
|
||||||
|
Below is a preview of each style:
|
||||||
|
|
||||||
`vertical-list`
|
`vertical-list`
|
||||||
|
|
||||||
@ -517,6 +525,9 @@ If an RSS feed isn't returning item links with a base domain and Glance has fail
|
|||||||
##### `limit`
|
##### `limit`
|
||||||
The maximum number of articles to show.
|
The maximum number of articles to show.
|
||||||
|
|
||||||
|
##### `single-line-titles`
|
||||||
|
When set to `true`, truncates the title of each post if it exceeds one line. Only applies when the style is set to `vertical-list`.
|
||||||
|
|
||||||
##### `collapse-after`
|
##### `collapse-after`
|
||||||
How many articles are visible before the "SHOW MORE" button appears. Set to `-1` to never collapse.
|
How many articles are visible before the "SHOW MORE" button appears. Set to `-1` to never collapse.
|
||||||
|
|
||||||
|
@ -85,12 +85,18 @@
|
|||||||
color: var(--color-primary);
|
color: var(--color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-truncate {
|
.text-truncate,
|
||||||
|
.single-line-titles .title
|
||||||
|
{
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.single-line-titles .title {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
.text-truncate-2-lines, .text-truncate-3-lines {
|
.text-truncate-2-lines, .text-truncate-3-lines {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{{ template "widget-base.html" . }}
|
{{ template "widget-base.html" . }}
|
||||||
|
|
||||||
{{ define "widget-content" }}
|
{{ define "widget-content" }}
|
||||||
<ul class="list list-gap-14 collapsible-container" data-collapse-after="{{ .CollapseAfter }}">
|
<ul class="list list-gap-14 collapsible-container{{ if .SingleLineTitles }} single-line-titles{{ end }}" data-collapse-after="{{ .CollapseAfter }}">
|
||||||
{{ range .Items }}
|
{{ range .Items }}
|
||||||
<li>
|
<li>
|
||||||
<a class="size-title-dynamic color-primary-if-not-visited" href="{{ .Link }}" target="_blank" rel="noreferrer">{{ .Title }}</a>
|
<a class="title size-title-dynamic color-primary-if-not-visited" href="{{ .Link }}" target="_blank" rel="noreferrer" title="{{ .Title }}">{{ .Title }}</a>
|
||||||
<ul class="list-horizontal-text flex-nowrap">
|
<ul class="list-horizontal-text flex-nowrap">
|
||||||
<li {{ dynamicRelativeTimeAttrs .PublishedAt }}></li>
|
<li {{ dynamicRelativeTimeAttrs .PublishedAt }}></li>
|
||||||
<li class="min-width-0">
|
<li class="min-width-0">
|
||||||
|
@ -18,6 +18,7 @@ type RSS struct {
|
|||||||
Items feed.RSSFeedItems `yaml:"-"`
|
Items feed.RSSFeedItems `yaml:"-"`
|
||||||
Limit int `yaml:"limit"`
|
Limit int `yaml:"limit"`
|
||||||
CollapseAfter int `yaml:"collapse-after"`
|
CollapseAfter int `yaml:"collapse-after"`
|
||||||
|
SingleLineTitles bool `yaml:"single-line-titles"`
|
||||||
NoItemsMessage string `yaml:"-"`
|
NoItemsMessage string `yaml:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user