A self-hosted dashboard that puts all your feeds in one place
Go aggregatordashboarddockerfeed-readergohomelabhomepagemonitoringredditrssrss-readerself-hostedstartpageyoutube
Tidy up
Svilen Markovc1251af597ef
diff --git a/internal/assets/templates/forum-posts.html b/internal/assets/templates/forum-posts.htmlindex 1ada8ec..8a71d22 100644--- a/internal/assets/templates/forum-posts.html+++ b/internal/assets/templates/forum-posts.html@@ -7,7 +7,7 @@<div class="flex gap-10 row-reverse-on-mobile thumbnail-parent">{{ if $.ShowThumbnails }}{{ if .IsCrosspost }}- <svg title="Crosspost" class="forum-post-list-thumbnail hide-on-mobile" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="-9 -8 40 40" stroke-width="1.5" stroke="var(--color-text-subdue)">+ <svg class="forum-post-list-thumbnail hide-on-mobile" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="-9 -8 40 40" stroke-width="1.5" stroke="var(--color-text-subdue)"><path stroke-linecap="round" stroke-linejoin="round" d="M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5" /></svg>{{ else if ne .ThumbnailUrl "" }}diff --git a/internal/feed/reddit.go b/internal/feed/reddit.goindex adeb263..297020c 100644--- a/internal/feed/reddit.go+++ b/internal/feed/reddit.go@@ -36,7 +36,7 @@ type subredditResponseJson struct {} `json:"data"`}-func templateRedditCommentsUrl(template, subreddit, postId, postPath string) string {+func templateRedditCommentsURL(template, subreddit, postId, postPath string) string {template = strings.ReplaceAll(template, "{SUBREDDIT}", subreddit)template = strings.ReplaceAll(template, "{POST-ID}", postId)template = strings.ReplaceAll(template, "{POST-PATH}", strings.TrimLeft(postPath, "/"))@@ -99,7 +99,7 @@ func FetchSubredditPosts(subreddit, sort, topPeriod, search, commentsUrlTemplateif commentsUrlTemplate == "" {commentsUrl = "https://www.reddit.com" + post.Permalink} else {- commentsUrl = templateRedditCommentsUrl(commentsUrlTemplate, subreddit, post.Id, post.Permalink)+ commentsUrl = templateRedditCommentsURL(commentsUrlTemplate, subreddit, post.Id, post.Permalink)}forumPost := ForumPost{@@ -126,10 +126,16 @@ func FetchSubredditPosts(subreddit, sort, topPeriod, search, commentsUrlTemplateif len(post.ParentList) > 0 {forumPost.IsCrosspost = trueforumPost.TargetUrlDomain = "r/" + post.ParentList[0].Subreddit+if commentsUrlTemplate == "" {forumPost.TargetUrl = "https://www.reddit.com" + post.ParentList[0].Permalink} else {- forumPost.TargetUrl = templateRedditCommentsUrl(commentsUrlTemplate, post.ParentList[0].Subreddit, post.ParentList[0].Id, post.ParentList[0].Permalink)+ forumPost.TargetUrl = templateRedditCommentsURL(+ commentsUrlTemplate,+ post.ParentList[0].Subreddit,+ post.ParentList[0].Id,+ post.ParentList[0].Permalink,+ )}}