1
0
Fork 0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2026-03-02 10:41:36 +00:00

Clickable usernames and hashtags

Should work well enough. Report edge cases.
This commit is contained in:
Cadence Fish 2020-02-04 03:30:19 +13:00
parent 1fcdfce868
commit 0ea95d1943
No known key found for this signature in database
GPG key ID: 81015DF9AA8607E1
9 changed files with 105 additions and 7 deletions

View file

@ -0,0 +1,11 @@
mixin display_structured(parts)
each part in parts
if part.type === "text"
= part.text
else if part.type === "user"
a(href="/u/"+part.user).link-to-user= part.text
else if part.type === "hashtag"
//- todo: add link to explore page, when explore page exists.
a.link-to-hashtag= part.text
else
| [UNKNOWN PART TYPE #{part.type}, TEXT:] [#{part.text}]