···11include ../mixins/comment
22include ../mixins/header
33+include ../utils
3445doctype html
56html
···910 title reddit
1011 link(rel='stylesheet', href='/styles.css')
1112 script(src="https://cdn.dashjs.org/latest/dash.all.min.js")
1313+ script.
1414+ function toggleDetails(details_id) {
1515+ var detailsElement = document.getElementById(details_id);
1616+ if (detailsElement) {
1717+ detailsElement.open = !detailsElement.open;
1818+ }
1919+ }
2020+1221 body
1322 main#content
1423 +header()
+23-13
src/views/index.pug
···11include ../mixins/post
22include ../mixins/sub
33include ../mixins/header
44+include ../utils
45- var subs = []
56doctype html
67html
···4243 +header()
43444445 div.hero
4545- a(href=`/r/${subreddit}`)
4646- h1 r/#{subreddit}
4646+ div.sub-title
4747+ a(href=`/r/${subreddit}`)
4848+ h1 r/#{subreddit}
4949+ div#button-container
4750 if about
4851 p #{about.public_description}
4949- div#button-container
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
5252+ details
5353+ summary sort by
5454+ div.sort-opts
5555+ a(href=`/r/${subreddit}?sort=hot`) hot
5656+ a(href=`/r/${subreddit}?sort=new`) new
5757+ a(href=`/r/${subreddit}?sort=rising`) rising
5858+ a(href=`/r/${subreddit}?sort=top`) top
5959+ a(href=`/r/${subreddit}?sort=top&t=day`) top day
6060+ a(href=`/r/${subreddit}?sort=top&t=week`) top week
6161+ a(href=`/r/${subreddit}?sort=top&t=month`) top month
6262+ a(href=`/r/${subreddit}?sort=top&t=year`) top year
6363+ a(href=`/r/${subreddit}?sort=top&t=all`) top all
57645865 if posts
5966 each child in posts.posts
6067 +post(child.data)
6161- div.footer
6262- div.footer-item
6363- a(href=`/r/${subreddit}?after=${posts.after}`) next →
6868+6969+ if posts.after
7070+ div.footer
7171+ div.footer-item
7272+ - var newQuery = {...query, after: posts.after}
7373+ a(href=`/r/${subreddit}?${encodeQueryParams(newQuery)}`) next →