aboutsummaryrefslogtreecommitdiff
path: root/src/mixins/post.pug
diff options
context:
space:
mode:
Diffstat (limited to 'src/mixins/post.pug')
-rw-r--r--src/mixins/post.pug25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mixins/post.pug b/src/mixins/post.pug
new file mode 100644
index 0000000..f5819d4
--- /dev/null
+++ b/src/mixins/post.pug
@@ -0,0 +1,25 @@
1include ../utils
2mixin post(p)
3 article.post
4 div.post-container
5 div.post-text
6 div.title-container
7 != p.title
8 span.domain (#{p.domain})
9 div.info-container
10 div.info-item ↑ #{fmtnum(p.ups)}
11 div.info-item by u/#{p.author}
12 div.info-item
13 a(href=`/r/${p.subreddit}`) r/#{p.subreddit}
14 div.info-item
15 a(href=`/comments/${p.id}`) #{fmtnum (p.num_comments)} #{fmttxt(p.num_comments, 'comment')}
16 div.media-preview
17 if p.post_hint == "image" || p.post_hint == "link"
18 if p.thumbnail && p.thumbnail != "self" || p.thumbnail != "default"
19 a(href=p.url)
20 img(src=p.thumbnail width='100px')
21 else if p.post_hint == "hosted:video"
22 - var url = p.secure_media.reddit_video.fallback_url
23 a(href=url)
24 video(src=url height='100px')
25