Browse Source

Display profile bio in preview

Zed 7 năm trước cách đây
mục cha
commit
73cfc6979f
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      src/formatters.nim

+ 4 - 1
src/formatters.nim

@@ -54,7 +54,10 @@ proc pageTitle*(profile: Profile): string =
   &"{profile.fullname} (@{profile.username})"
 
 proc pageDesc*(profile: Profile): string =
-  "The latest tweets from " & profile.fullname
+  if profile.bio.len > 0:
+    stripHtml(profile.bio)
+  else:
+    "The latest tweets from " & profile.fullname
 
 proc getJoinDate*(profile: Profile): string =
   profile.joinDate.format("'Joined' MMMM YYYY")