mirror of
https://github.com/glanceapp/glance.git
synced 2025-06-21 18:31:24 +02:00
Add description property to bookmarks widget links
This commit is contained in:
parent
31ecd91f7c
commit
6c8859863a
@ -2057,6 +2057,7 @@ An array of groups which can optionally have a title and a custom color.
|
|||||||
| ---- | ---- | -------- | ------- |
|
| ---- | ---- | -------- | ------- |
|
||||||
| title | string | yes | |
|
| title | string | yes | |
|
||||||
| url | string | yes | |
|
| url | string | yes | |
|
||||||
|
| description | string | no | |
|
||||||
| icon | string | no | |
|
| icon | string | no | |
|
||||||
| same-tab | boolean | no | false |
|
| same-tab | boolean | no | false |
|
||||||
| hide-arrow | boolean | no | false |
|
| hide-arrow | boolean | no | false |
|
||||||
|
@ -2,22 +2,29 @@
|
|||||||
|
|
||||||
{{ define "widget-content" }}
|
{{ define "widget-content" }}
|
||||||
<div class="dynamic-columns list-gap-24 list-with-separator">
|
<div class="dynamic-columns list-gap-24 list-with-separator">
|
||||||
{{ range .Groups }}
|
{{- range .Groups }}
|
||||||
<div class="bookmarks-group"{{ if .Color }} style="--bookmarks-group-color: {{ .Color.String | safeCSS }}"{{ end }}>
|
<div class="bookmarks-group"{{ if .Color }} style="--bookmarks-group-color: {{ .Color.String | safeCSS }}"{{ end }}>
|
||||||
{{ if ne .Title "" }}<div class="bookmarks-group-title size-h3 margin-bottom-3">{{ .Title }}</div>{{ end }}
|
{{- if ne .Title "" }}
|
||||||
|
<div class="bookmarks-group-title size-h3 margin-bottom-3">{{ .Title }}</div>
|
||||||
|
{{- end }}
|
||||||
<ul class="list list-gap-2">
|
<ul class="list list-gap-2">
|
||||||
{{ range .Links }}
|
{{- range .Links }}
|
||||||
<li class="flex items-center gap-10">
|
<li>
|
||||||
{{ if ne "" .Icon.URL }}
|
<div class="flex items-center gap-10">
|
||||||
|
{{- if ne "" .Icon.URL }}
|
||||||
<div class="bookmarks-icon-container">
|
<div class="bookmarks-icon-container">
|
||||||
<img class="bookmarks-icon{{ if .Icon.IsFlatIcon }} flat-icon{{ end }}" src="{{ .Icon.URL }}" alt="" loading="lazy">
|
<img class="bookmarks-icon{{ if .Icon.IsFlatIcon }} flat-icon{{ end }}" src="{{ .Icon.URL }}" alt="" loading="lazy">
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
<a href="{{ .URL | safeURL }}" class="bookmarks-link {{ if .HideArrow }}bookmarks-link-no-arrow {{ end }}color-highlight size-h4" {{ if .Target }}target="{{ .Target }}"{{ end }} rel="noreferrer">{{ .Title }}</a>
|
<a href="{{ .URL | safeURL }}" class="bookmarks-link {{ if .HideArrow }}bookmarks-link-no-arrow {{ end }}color-highlight size-h4" {{ if .Target }}target="{{ .Target }}"{{ end }} rel="noreferrer">{{ .Title }}</a>
|
||||||
|
</div>
|
||||||
|
{{- if .Description }}
|
||||||
|
<div class="margin-bottom-5">{{ .Description }}</div>
|
||||||
|
{{- end }}
|
||||||
</li>
|
</li>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -18,6 +18,7 @@ type bookmarksWidget struct {
|
|||||||
Links []struct {
|
Links []struct {
|
||||||
Title string `yaml:"title"`
|
Title string `yaml:"title"`
|
||||||
URL string `yaml:"url"`
|
URL string `yaml:"url"`
|
||||||
|
Description string `yaml:"description"`
|
||||||
Icon customIconField `yaml:"icon"`
|
Icon customIconField `yaml:"icon"`
|
||||||
// we need a pointer to bool to know whether a value was provided,
|
// we need a pointer to bool to know whether a value was provided,
|
||||||
// however there's no way to dereference a pointer in a template so
|
// however there's no way to dereference a pointer in a template so
|
||||||
|
Loading…
x
Reference in New Issue
Block a user