···2121 var aboutReq = G.getSubreddit(`${subreddit}`);
22222323 var [posts, about] = await Promise.all([postsReq, aboutReq]);
2424- console.log(`posts for ${subreddit}`);
2525- console.log(posts.posts.length);
26242725 res.render('index', { subreddit, posts, about });
2826});
+11-1
src/views/comments.pug
···11include ../mixins/comment
22+include ../mixins/header
2334doctype html
45html
···1011 script(src="https://cdn.dashjs.org/latest/dash.all.min.js")
1112 body
1213 main#content
1414+ +header()
1315 div.hero
1414- h4 r/#{post.subreddit}
1616+ h3
1717+ a(href=`/r/${post.subreddit}`) r/#{post.subreddit}
1818+1519 h2 #{post.title}
16201721 if post.is_gallery && post.is_gallery == true
···28322933 if post.selftext_html
3034 p.self-text !{post.selftext_html}
3535+ div.info-container
3636+ p
3737+ | #{fmtnum(post.ups)} ↑
3838+ | · by u/#{post.author}
3939+4040+ hr
31413242 div.comments-container
3343 each child in comments
+10-9
src/views/index.pug
···11include ../mixins/post
22include ../mixins/sub
33+include ../mixins/header
34- var subs = []
45doctype html
56html
···3839 document.addEventListener('DOMContentLoaded', ()=>updateButton("#{subreddit}"));
3940 body
4041 main#content
4141- div.header
4242- div.header-item
4343- a(href=`/`) home
4444- div.header-item
4545- a(href=`/subs`) subscriptions
4646- div.header-item
4747- a(href=`/r/popular`) popular
4242+ +header()
48434944 div.hero
5045 a(href=`/r/${subreddit}`)
···5247 if about
5348 p #{about.public_description}
5449 div#button-container
5555- a(href=`/r/${subreddit}`)
5050+ ul
5151+ li
5252+ a(href=`/r/${subreddit}/hot`) hot
5353+ li
5454+ a(href=`/r/${subreddit}/top`) top
5555+ li
5656+ a(href=`/r/${subreddit}/top?t=all`) top all
56575758 if posts
5859 each child in posts.posts
5960 +post(child.data)
6061 div.footer
6162 div.footer-item
6262- a(href=`/r/${subreddit}?after=${posts.after}`) next
6363+ a(href=`/r/${subreddit}?after=${posts.after}`) next →