Skip to content

Commit c548151

Browse files
zedeusKris
authored andcommitted
Embed quote tweet in RSS
Fixes zedeus#132 Closes zedeus#820
1 parent 05b7edf commit c548151

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;" />
@@ -75,6 +71,20 @@ Twitter feed for: ${desc}. Generated by ${cfg.hostname}
7571
<img src="${urlPrefix}${getPicUrl(card.image)}" style="max-width:250px;" />
7672
# end if
7773
#end if
74+
#if tweet.quote.isSome and get(tweet.quote).available:
75+
# let quoteTweet = get(tweet.quote)
76+
# let quoteLink = urlPrefix & getLink(quoteTweet)
77+
<hr/>
78+
<blockquote>
79+
<b>${quoteTweet.user.fullname} (@${quoteTweet.user.username})</b>
80+
<p>
81+
${renderRssTweet(quoteTweet, cfg)}
82+
</p>
83+
<footer>
84+
— <cite><a href="${quoteLink}">${quoteLink}</a>
85+
</footer>
86+
</blockquote>
87+
#end if
7888
#end proc
7989
#
8090
#proc renderRssTweets(tweets: seq[Tweets]; cfg: Config; userId=""): string =

0 commit comments

Comments
 (0)