Add Articles tab to profile pages

Fixes #1426
This commit is contained in:
Zed 2026-08-24 22:15:50 +07:00
commit 8142bab1a9
13 changed files with 103 additions and 39 deletions

View file

@ -17,6 +17,11 @@
## text = unicode.runeSubStr(text, 0, 32) & "..."
##end if
#text = xmltree.escape(text)
## article tweets' text is just the article link; the title says more
#if tweet.articlePreview.isSome and tweet.articlePreview.get().title.len > 0:
# result = prefix & xmltree.escape(tweet.articlePreview.get().title)
# return
#end if
#if text.len > 0:
# result = prefix & text
# return
@ -34,12 +39,6 @@
# end case
# end if
#end if
#if result.len == 0 and tweet.articlePreview.isSome:
# let art = tweet.articlePreview.get()
# if art.title.len > 0:
# result = prefix & xmltree.escape(art.title)
# end if
#end if
#if result.len == 0 and tweet.card.isSome:
# let card = tweet.card.get()
# if card.kind notin {hidden, unknown} and card.title.len > 0:

View file

@ -36,6 +36,9 @@ proc renderProfileTabs*(query: Query; username: string): VNode =
a(href=(link & "/with_replies")): text "Tweets & Replies"
li(class=query.getTabClass(media)):
a(href=(link & "/media")): text "Media"
if query.fromUser.len == 1:
li(class=query.getTabClass(QueryKind.articles)):
a(href=(link & "/articles")): text "Articles"
li(class=query.getTabClass(tweets)):
a(href=(link & "/search")): text "Search"