diff options
Diffstat (limited to 'src/views/index.pug')
-rw-r--r-- | src/views/index.pug | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/views/index.pug b/src/views/index.pug index 3f284f3..01b2941 100644 --- a/src/views/index.pug +++ b/src/views/index.pug | |||
@@ -1,6 +1,7 @@ | |||
1 | include ../mixins/post | 1 | include ../mixins/post |
2 | include ../mixins/sub | 2 | include ../mixins/sub |
3 | include ../mixins/header | 3 | include ../mixins/header |
4 | include ../utils | ||
4 | - var subs = [] | 5 | - var subs = [] |
5 | doctype html | 6 | doctype html |
6 | html | 7 | html |
@@ -42,22 +43,31 @@ html | |||
42 | +header() | 43 | +header() |
43 | 44 | ||
44 | div.hero | 45 | div.hero |
45 | a(href=`/r/${subreddit}`) | 46 | div.sub-title |
46 | h1 r/#{subreddit} | 47 | a(href=`/r/${subreddit}`) |
48 | h1 r/#{subreddit} | ||
49 | div#button-container | ||
47 | if about | 50 | if about |
48 | p #{about.public_description} | 51 | p #{about.public_description} |
49 | div#button-container | 52 | details |
50 | ul | 53 | summary sort by |
51 | li | 54 | div.sort-opts |
52 | a(href=`/r/${subreddit}/hot`) hot | 55 | a(href=`/r/${subreddit}?sort=hot`) hot |
53 | li | 56 | a(href=`/r/${subreddit}?sort=new`) new |
54 | a(href=`/r/${subreddit}/top`) top | 57 | a(href=`/r/${subreddit}?sort=rising`) rising |
55 | li | 58 | a(href=`/r/${subreddit}?sort=top`) top |
56 | a(href=`/r/${subreddit}/top?t=all`) top all | 59 | a(href=`/r/${subreddit}?sort=top&t=day`) top day |
60 | a(href=`/r/${subreddit}?sort=top&t=week`) top week | ||
61 | a(href=`/r/${subreddit}?sort=top&t=month`) top month | ||
62 | a(href=`/r/${subreddit}?sort=top&t=year`) top year | ||
63 | a(href=`/r/${subreddit}?sort=top&t=all`) top all | ||
57 | 64 | ||
58 | if posts | 65 | if posts |
59 | each child in posts.posts | 66 | each child in posts.posts |
60 | +post(child.data) | 67 | +post(child.data) |
61 | div.footer | 68 | |
62 | div.footer-item | 69 | if posts.after |
63 | a(href=`/r/${subreddit}?after=${posts.after}`) next → | 70 | div.footer |
71 | div.footer-item | ||
72 | - var newQuery = {...query, after: posts.after} | ||
73 | a(href=`/r/${subreddit}?${encodeQueryParams(newQuery)}`) next → | ||