Skip to content

Commit 2b922c0

Browse files
authored
Embed quote tweet in RSS (#1316)
Fixes #132 Closes #820
1 parent 78101df commit 2b922c0

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/views/rss.nimf

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#end proc
2626
#
2727
#proc getDescription(desc: string; cfg: Config): string =
28-
Twitter feed for: ${desc}. Generated by ${cfg.hostname}
28+
Twitter feed for: ${desc}. Generated by ${getUrlPrefix(cfg)}
2929
#end proc
3030
#
3131
#proc getTweetsWithPinned(profile: Profile): seq[Tweets] =
@@ -51,10 +51,6 @@ Twitter feed for: ${desc}. Generated by ${cfg.hostname}
5151
#let urlPrefix = getUrlPrefix(cfg)
5252
#let text = replaceUrls(tweet.text, defaultPrefs, absolute=urlPrefix)
5353
<p>${text.replace("\n", "<br>\n")}</p>
54-
#if tweet.quote.isSome and get(tweet.quote).available:
55-
# let quoteLink = getLink(get(tweet.quote))
56-
<p><a href="${urlPrefix}${quoteLink}">${cfg.hostname}${quoteLink}</a></p>
57-
#end if
5854
#if tweet.photos.len > 0:
5955
# for photo in tweet.photos:
6056
<img src="${urlPrefix}${getPicUrl(photo)}" style="max-width:250px;" />
@@ -72,6 +68,20 @@ Twitter feed for: ${desc}. Generated by ${cfg.hostname}
7268
<img src="${urlPrefix}${getPicUrl(card.image)}" style="max-width:250px;" />
7369
# end if
7470
#end if
71+
#if tweet.quote.isSome and get(tweet.quote).available:
72+
# let quoteTweet = get(tweet.quote)
73+
# let quoteLink = urlPrefix & getLink(quoteTweet)
74+
<hr/>
75+
<blockquote>
76+
<b>${quoteTweet.user.fullname} (@${quoteTweet.user.username})</b>
77+
<p>
78+
${renderRssTweet(quoteTweet, cfg)}
79+
</p>
80+
<footer>
81+
— <cite><a href="${quoteLink}">${quoteLink}</a>
82+
</footer>
83+
</blockquote>
84+
#end if
7585
#end proc
7686
#
7787
#proc renderRssTweets(tweets: seq[Tweets]; cfg: Config; userId=""): string =

0 commit comments

Comments
 (0)