Skip to content

Commit d71da4c

Browse files
committed
Add latest community widgets widget
widgetception
1 parent 70d167f commit d71da4c

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
![](preview.png)
2+
3+
```yml
4+
- type: custom-api
5+
title: Latest Community Widgets
6+
cache: 1d
7+
url: https://raw.githubusercontent.com/glanceapp/community-widgets/refs/heads/main/registry/widgets.json
8+
template: |
9+
<ul class="list list-gap-14 collapsible-container" data-collapse-after="3">
10+
{{ $widgets := .JSON.Array "" | sortByTime "time_added" "rfc3339" "desc" }}
11+
{{ if gt (len $widgets) 10 }}
12+
{{ $widgets = slice $widgets 0 10 }}
13+
{{ end }}
14+
{{ range $widgets }}
15+
<li>
16+
<a class="size-h4 block text-truncate color-primary-if-not-visited" href="https://github.com/glanceapp/community-widgets/blob/main/widgets/{{ .String "directory" }}/README.md" target="_blank" rel="noreferrer">{{ .String "title" }}</a>
17+
<p class="text-truncate-2-lines margin-top-3">{{ .String "description" }}</p>
18+
<ul class="list-horizontal-text margin-top-3">
19+
<li {{ .String "time_added" | parseRelativeTime "rfc3339" }}></li>
20+
<li>{{ .String "author" }}</li>
21+
</ul>
22+
</li>
23+
{{ end }}
24+
</ul>
25+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
title: Latest Community Widgets
2+
description: show a list of the most recently added community widgets
3+
author: svilenmarkov
25.5 KB
Loading

0 commit comments

Comments
 (0)