nandi/gleanpublic⑂ Fork 0
⑂ aff0b5f
Commits
⬇ Clone ▾
git clone https://git.rickub.com/nandi/glean.git
git clone ssh://git@rickub.com/nandi/glean.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Extract trending card template and apply consistentlyUnverified

Julien Robert committed 2026-04-21T17:35:20+02:00 Browse files
aff0b5f parent: 788527a
modified internal/tmpl/dashboard.html +38 -56
@@ -6,6 +6,7 @@
66 <span class="text-spot-secondary"><strong class="text-spot-text">{{.SubscriptionCount}}</strong> feeds</span>
77 </div>
88 </div>
9+
910 {{if eq .SubscriptionCount 0}}
1011 <div class="bg-spot-surface rounded-xl py-12 px-6 text-center mb-6">
1112 <div class="w-16 h-16 rounded-full bg-spot-hover flex items-center justify-center mb-4 mx-auto">
@@ -25,55 +26,46 @@
2526 <h2 class="text-lg font-semibold text-spot-text">Trending</h2>
2627 <a href="/trending" class="text-xs text-spot-secondary hover:text-spot-green uppercase tracking-button transition">See all</a>
2728 </div>
28- <div class="grid grid-cols-1 md:grid-cols-2 gap-3">
29+ <div class="space-y-3">
2930 {{range .GlobalTrending}}
30- <div class="bg-spot-surface rounded-xl p-4 hover:bg-spot-hover-50 transition">
31- <a href="/articles/{{.ArticleID}}" class="font-bold text-sm text-spot-text leading-tight hover:text-spot-green transition">{{.Title}}</a>
32- <div class="flex items-center gap-2 mt-1 text-xs text-spot-secondary">
33- {{if .Author}}<span>{{.Author}}</span>{{end}}
34- <span class="text-spot-muted"><a href="/articles?feed={{.FeedURL}}" class="hover:text-spot-green transition">{{if .FeedTitle}}{{.FeedTitle}}{{end}}</a></span>
35- </div>
36- <div class="flex items-center gap-3 mt-2 text-xs text-spot-secondary">
37- <span class="inline-flex items-center gap-1"><svg class="w-4 h-4 text-spot-muted" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">{{template "icon-heart"}}</svg> {{.LikeCount}}</span>
38- <span class="text-spot-muted">{{.AnnotationCount}} notes</span>
39- </div>
40- </div>
41- {{end}}
42- </div>
43- </div>
31+ {{template "trending-card.html" .}}
4432 {{end}}
33+ </div>
34+</div>
35+{{end}}
4536
46- {{if .FeedRecommendations}}
47- <div>
48- <h2 class="text-lg font-semibold text-spot-text mb-3">Popular feeds to get started</h2>
49- <div class="grid grid-cols-1 md:grid-cols-2 gap-3">
50- {{range .FeedRecommendations}}
51- {{template "recommendation-card.html" (dict "title" .Title "feed_url" .FeedURL "description" .Description "favicon_url" .FaviconURL "subscriber_count" .SubscriberCount "CSRFToken" $.CSRFToken)}}
52- {{end}}
53- </div>
54- </div>
37+{{if .FeedRecommendations}}
38+<div>
39+ <h2 class="text-lg font-semibold text-spot-text mb-3">Popular feeds to get started</h2>
40+ <div class="grid grid-cols-1 md:grid-cols-2 gap-3">
41+ {{range .FeedRecommendations}}
42+ {{template "recommendation-card.html" (dict "title" .Title "feed_url" .FeedURL "description" .Description "favicon_url" .FaviconURL "subscriber_count" .SubscriberCount "CSRFToken" $.CSRFToken)}}
5543 {{end}}
56- {{else}}
57- <p class="text-sm text-spot-secondary mb-6">Your personalized feed, based on your social graph.</p>
44+ </div>
45+</div>
46+{{end}}
47+
48+{{else}}
49+<p class="text-sm text-spot-secondary mb-6">Your personalized feed, based on your social graph.</p>
5850
59- <div id="new-articles-poll" hx-get="/articles/new-count?since={{.Now.Unix}}&return=/dashboard" hx-trigger="every 30s" hx-swap="innerHTML"></div>
51+<div id="new-articles-poll" hx-get="/articles/new-count?since={{.Now.Unix}}&return=/dashboard" hx-trigger="every 30s" hx-swap="innerHTML"></div>
6052
61- <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
62- <div class="lg:col-span-2">
63- {{if .ArticleRecommendations}}
64- <div class="mb-6">
65- <h2 class="text-lg font-semibold text-spot-text mb-3">Recommended for you</h2>
66- <div class="space-y-3">
67- {{range .ArticleRecommendations}}
68- <div class="bg-spot-surface rounded-xl p-4 hover:bg-spot-hover-50 transition">
69- <a href="/articles/{{.ArticleID}}" class="font-bold text-sm text-spot-text leading-tight hover:text-spot-green transition">{{.Title}}</a>
70- <div class="flex items-center gap-2 mt-1 text-xs text-spot-secondary">
71- {{if .Author}}<span>{{.Author}}</span>{{end}}
72- <a href="/articles?feed={{.FeedURL}}" class="text-spot-muted hover:text-spot-green transition">{{.FeedTitle}}</a>
73- {{if .Published.Valid}}<span>{{.Published.Time.Format "Jan 2"}}</span>{{end}}
74- </div>
75- {{if .Summary}}<p class="text-xs text-spot-secondary mt-2 line-clamp-2">{{.Summary}}</p>{{end}}
76- </div>
53+<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
54+ <div class="lg:col-span-2">
55+ {{if .ArticleRecommendations}}
56+ <div class="mb-6">
57+ <h2 class="text-lg font-semibold text-spot-text mb-3">Recommended for you</h2>
58+ <div class="space-y-3">
59+ {{range .ArticleRecommendations}}
60+ <div class="bg-spot-surface rounded-xl px-5 py-4 hover:bg-spot-hover-50 transition">
61+ <a href="/articles/{{.ArticleID}}" class="font-bold text-spot-text hover:text-spot-green transition text-lg leading-tight">{{.Title}}</a>
62+ <div class="text-sm text-spot-secondary mt-1 flex items-center gap-2">
63+ {{if .Author}}<span>{{.Author}}</span>{{end}}
64+ <span class="text-spot-muted"><a href="/articles?feed={{.FeedURL}}" class="hover:text-spot-green transition">{{.FeedTitle}}</a></span>
65+ {{if .Published.Valid}}<span>{{.Published.Time.Format "Jan 2"}}</span>{{end}}
66+ </div>
67+ {{if .Summary}}<p class="text-sm text-spot-secondary mt-2 line-clamp-2">{{.Summary}}</p>{{end}}
68+ </div>
7769 {{end}}
7870 </div>
7971 </div>
@@ -122,20 +114,10 @@
122114 </div>
123115 <div class="space-y-3">
124116 {{range .PersonalTrending}}
125- <div class="bg-spot-surface rounded-xl p-4 hover:bg-spot-hover-50 transition">
126- <a href="/articles/{{.ArticleID}}" class="font-bold text-sm text-spot-text leading-tight hover:text-spot-green transition">{{.Title}}</a>
127- <div class="flex items-center gap-2 mt-1 text-xs text-spot-secondary">
128- {{if .Author}}<span>{{.Author}}</span>{{end}}
129- <span class="text-spot-muted"><a href="/articles?feed={{.FeedURL}}" class="hover:text-spot-green transition">{{if .FeedTitle}}{{.FeedTitle}}{{end}}</a></span>
130- </div>
131- <div class="flex items-center gap-3 mt-2 text-xs text-spot-secondary">
132- <span class="inline-flex items-center gap-1"><svg class="w-4 h-4 text-spot-muted" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">{{template "icon-heart"}}</svg> {{.LikeCount}}</span>
133- <span class="text-spot-muted">{{.AnnotationCount}} notes</span>
134- </div>
135- </div>
136- {{end}}
137- </div>
117+ {{template "trending-card.html" .}}
118+ {{end}}
138119 </div>
120+ </div>
139121 {{end}}
140122
141123 {{if .PeopleRecommendations}}
@@ -6,6 +6,7 @@
6 <span class="text-spot-secondary"><strong class="text-spot-text">{{.SubscriptionCount}}</strong> feeds</span>6 <span class="text-spot-secondary"><strong class="text-spot-text">{{.SubscriptionCount}}</strong> feeds</span>
7 </div>7 </div>
8 </div>8 </div>
9+
9 {{if eq .SubscriptionCount 0}}10 {{if eq .SubscriptionCount 0}}
10 <div class="bg-spot-surface rounded-xl py-12 px-6 text-center mb-6">11 <div class="bg-spot-surface rounded-xl py-12 px-6 text-center mb-6">
11 <div class="w-16 h-16 rounded-full bg-spot-hover flex items-center justify-center mb-4 mx-auto">12 <div class="w-16 h-16 rounded-full bg-spot-hover flex items-center justify-center mb-4 mx-auto">
@@ -25,55 +26,46 @@
25 <h2 class="text-lg font-semibold text-spot-text">Trending</h2>26 <h2 class="text-lg font-semibold text-spot-text">Trending</h2>
26 <a href="/trending" class="text-xs text-spot-secondary hover:text-spot-green uppercase tracking-button transition">See all</a>27 <a href="/trending" class="text-xs text-spot-secondary hover:text-spot-green uppercase tracking-button transition">See all</a>
27 </div>28 </div>
28- <div class="grid grid-cols-1 md:grid-cols-2 gap-3">29+ <div class="space-y-3">
29 {{range .GlobalTrending}}30 {{range .GlobalTrending}}
30- <div class="bg-spot-surface rounded-xl p-4 hover:bg-spot-hover-50 transition">31+ {{template "trending-card.html" .}}
31- <a href="/articles/{{.ArticleID}}" class="font-bold text-sm text-spot-text leading-tight hover:text-spot-green transition">{{.Title}}</a>
32- <div class="flex items-center gap-2 mt-1 text-xs text-spot-secondary">
33- {{if .Author}}<span>{{.Author}}</span>{{end}}
34- <span class="text-spot-muted"><a href="/articles?feed={{.FeedURL}}" class="hover:text-spot-green transition">{{if .FeedTitle}}{{.FeedTitle}}{{end}}</a></span>
35- </div>
36- <div class="flex items-center gap-3 mt-2 text-xs text-spot-secondary">
37- <span class="inline-flex items-center gap-1"><svg class="w-4 h-4 text-spot-muted" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">{{template "icon-heart"}}</svg> {{.LikeCount}}</span>
38- <span class="text-spot-muted">{{.AnnotationCount}} notes</span>
39- </div>
40- </div>
41- {{end}}
42- </div>
43- </div>
44 {{end}}32 {{end}}
33+ </div>
34+</div>
35+{{end}}
45 36
46- {{if .FeedRecommendations}}37+{{if .FeedRecommendations}}
47- <div>38+<div>
48- <h2 class="text-lg font-semibold text-spot-text mb-3">Popular feeds to get started</h2>39+ <h2 class="text-lg font-semibold text-spot-text mb-3">Popular feeds to get started</h2>
49- <div class="grid grid-cols-1 md:grid-cols-2 gap-3">40+ <div class="grid grid-cols-1 md:grid-cols-2 gap-3">
50- {{range .FeedRecommendations}}41+ {{range .FeedRecommendations}}
51- {{template "recommendation-card.html" (dict "title" .Title "feed_url" .FeedURL "description" .Description "favicon_url" .FaviconURL "subscriber_count" .SubscriberCount "CSRFToken" $.CSRFToken)}}42+ {{template "recommendation-card.html" (dict "title" .Title "feed_url" .FeedURL "description" .Description "favicon_url" .FaviconURL "subscriber_count" .SubscriberCount "CSRFToken" $.CSRFToken)}}
52- {{end}}
53- </div>
54- </div>
55 {{end}}43 {{end}}
56- {{else}}44+ </div>
57- <p class="text-sm text-spot-secondary mb-6">Your personalized feed, based on your social graph.</p>45+</div>
46+{{end}}
47+
48+{{else}}
49+<p class="text-sm text-spot-secondary mb-6">Your personalized feed, based on your social graph.</p>
58 50
59- <div id="new-articles-poll" hx-get="/articles/new-count?since={{.Now.Unix}}&return=/dashboard" hx-trigger="every 30s" hx-swap="innerHTML"></div>51+<div id="new-articles-poll" hx-get="/articles/new-count?since={{.Now.Unix}}&return=/dashboard" hx-trigger="every 30s" hx-swap="innerHTML"></div>
60 52
61- <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">53+<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
62- <div class="lg:col-span-2">54+ <div class="lg:col-span-2">
63- {{if .ArticleRecommendations}}55+ {{if .ArticleRecommendations}}
64- <div class="mb-6">56+ <div class="mb-6">
65- <h2 class="text-lg font-semibold text-spot-text mb-3">Recommended for you</h2>57+ <h2 class="text-lg font-semibold text-spot-text mb-3">Recommended for you</h2>
66- <div class="space-y-3">58+ <div class="space-y-3">
67- {{range .ArticleRecommendations}}59+ {{range .ArticleRecommendations}}
68- <div class="bg-spot-surface rounded-xl p-4 hover:bg-spot-hover-50 transition">60+ <div class="bg-spot-surface rounded-xl px-5 py-4 hover:bg-spot-hover-50 transition">
69- <a href="/articles/{{.ArticleID}}" class="font-bold text-sm text-spot-text leading-tight hover:text-spot-green transition">{{.Title}}</a>61+ <a href="/articles/{{.ArticleID}}" class="font-bold text-spot-text hover:text-spot-green transition text-lg leading-tight">{{.Title}}</a>
70- <div class="flex items-center gap-2 mt-1 text-xs text-spot-secondary">62+ <div class="text-sm text-spot-secondary mt-1 flex items-center gap-2">
71- {{if .Author}}<span>{{.Author}}</span>{{end}}63+ {{if .Author}}<span>{{.Author}}</span>{{end}}
72- <a href="/articles?feed={{.FeedURL}}" class="text-spot-muted hover:text-spot-green transition">{{.FeedTitle}}</a>64+ <span class="text-spot-muted"><a href="/articles?feed={{.FeedURL}}" class="hover:text-spot-green transition">{{.FeedTitle}}</a></span>
73- {{if .Published.Valid}}<span>{{.Published.Time.Format "Jan 2"}}</span>{{end}}65+ {{if .Published.Valid}}<span>{{.Published.Time.Format "Jan 2"}}</span>{{end}}
74- </div>66+ </div>
75- {{if .Summary}}<p class="text-xs text-spot-secondary mt-2 line-clamp-2">{{.Summary}}</p>{{end}}67+ {{if .Summary}}<p class="text-sm text-spot-secondary mt-2 line-clamp-2">{{.Summary}}</p>{{end}}
76- </div>68+ </div>
77 {{end}}69 {{end}}
78 </div>70 </div>
79 </div>71 </div>
@@ -122,20 +114,10 @@
122 </div>114 </div>
123 <div class="space-y-3">115 <div class="space-y-3">
124 {{range .PersonalTrending}}116 {{range .PersonalTrending}}
125- <div class="bg-spot-surface rounded-xl p-4 hover:bg-spot-hover-50 transition">117+ {{template "trending-card.html" .}}
126- <a href="/articles/{{.ArticleID}}" class="font-bold text-sm text-spot-text leading-tight hover:text-spot-green transition">{{.Title}}</a>118+ {{end}}
127- <div class="flex items-center gap-2 mt-1 text-xs text-spot-secondary">
128- {{if .Author}}<span>{{.Author}}</span>{{end}}
129- <span class="text-spot-muted"><a href="/articles?feed={{.FeedURL}}" class="hover:text-spot-green transition">{{if .FeedTitle}}{{.FeedTitle}}{{end}}</a></span>
130- </div>
131- <div class="flex items-center gap-3 mt-2 text-xs text-spot-secondary">
132- <span class="inline-flex items-center gap-1"><svg class="w-4 h-4 text-spot-muted" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">{{template "icon-heart"}}</svg> {{.LikeCount}}</span>
133- <span class="text-spot-muted">{{.AnnotationCount}} notes</span>
134- </div>
135- </div>
136- {{end}}
137- </div>
138 </div>119 </div>
120+ </div>
139 {{end}}121 {{end}}
140 122
141 {{if .PeopleRecommendations}}123 {{if .PeopleRecommendations}}