···67- var post = data.post
8- var comments = data.comments
009doctype html
10html
11 +head(post.title)
···27 |
28 | ·
29 |
30- a(href=`/r/${post.subreddit}`) r/#{post.subreddit}
3132 div.info-container
33 - var domain = (new URL(post.url)).hostname
···6566 if post.selftext_html
67 div.self-text
68- != post.selftext_html
6970 hr
71
···67- var post = data.post
8- var comments = data.comments
9+- var viewQuery = 'view=' + (query && query.view ? query.view : 'compact')
10+- var sortQuery = 'sort=' + (query && query.sort ? query.sort + (query.t ? '&t=' + query.t : '') : 'hot')
11doctype html
12html
13 +head(post.title)
···29 |
30 | ·
31 |
32+ a(href=`/r/${post.subreddit}?${sortQuery}&${viewQuery}`) r/#{post.subreddit}
3334 div.info-container
35 - var domain = (new URL(post.url)).hostname
···6768 if post.selftext_html
69 div.self-text
70+ != convertInlineImageLinks(post.selftext_html)
7172 hr
73
+20-13
src/views/index.pug
···2include ../mixins/header
3include ../mixins/head
4include ../utils
005doctype html
6html
7 +head("home")
···14 div.sub-title
15 h1
16 if isMulti
17- a(href=`/`) lurker
18 else
19- a(href=`/r/${subreddit}`)
20 | r/#{subreddit}
21 if !isMulti
22 div#button-container
···32 a(href="https://donate.stripe.com/dR62bTaZH1295Da4gg") oppiliappan
33 |, author of lurker
34 hr
35- details
36- summary.sorting sorting by #{query.sort + (query.t?' '+query.t:'')}
37 div.sort-opts
38 div
39- a(href=`/r/${subreddit}?sort=hot`) hot
40 div
41- a(href=`/r/${subreddit}?sort=new`) new
000042 div
43- a(href=`/r/${subreddit}?sort=rising`) rising
44 div
45- a(href=`/r/${subreddit}?sort=top`) top
46 div
47- a(href=`/r/${subreddit}?sort=top&t=day`) top day
48 div
49- a(href=`/r/${subreddit}?sort=top&t=week`) top week
50 div
51- a(href=`/r/${subreddit}?sort=top&t=month`) top month
052 div
53- a(href=`/r/${subreddit}?sort=top&t=year`) top year
54 div
55- a(href=`/r/${subreddit}?sort=top&t=all`) top all
5657 if posts
58 each child in posts.posts
···2include ../mixins/header
3include ../mixins/head
4include ../utils
5+ - var viewQuery = query && query.view ? query.view : 'compact'
6+ - var sortQuery = query && query.sort ? query.sort + (query.t ? '&t=' + query.t : '') : 'hot'
7doctype html
8html
9 +head("home")
···16 div.sub-title
17 h1
18 if isMulti
19+ a(href=`/?${sortQuery}&${viewQuery}`) lurker
20 else
21+ a(href=`/r/${subreddit}?${sortQuery}&${viewQuery}`)
22 | r/#{subreddit}
23 if !isMulti
24 div#button-container
···34 a(href="https://donate.stripe.com/dR62bTaZH1295Da4gg") oppiliappan
35 |, author of lurker
36 hr
37+ details.sort-details
38+ summary.sorting sorting by #{query.sort + (query.t?' '+query.t:'')}, #{viewQuery} view
39 div.sort-opts
40 div
41+ a(href=`/r/${subreddit}?sort=hot&view=${viewQuery}`) hot
42 div
43+ a(href=`/r/${subreddit}?sort=new&view=${viewQuery}`) new
44+ div
45+ a(href=`/r/${subreddit}?sort=rising&view=${viewQuery}`) rising
46+ div
47+ a(href=`/r/${subreddit}?sort=top&view=${viewQuery}`) top
48 div
49+ a(href=`/r/${subreddit}?sort=top&t=day&view=${viewQuery}`) top day
50 div
51+ a(href=`/r/${subreddit}?sort=top&t=week&view=${viewQuery}`) top week
52 div
53+ a(href=`/r/${subreddit}?sort=top&t=month&view=${viewQuery}`) top month
54 div
55+ a(href=`/r/${subreddit}?sort=top&t=year&view=${viewQuery}`) top year
56 div
57+ a(href=`/r/${subreddit}?sort=top&t=all&view=${viewQuery}`) top all
58+ div.sort-opts
59 div
60+ a(href=`/r/${subreddit}?sort=${sortQuery}&view=compact`) compact
61 div
62+ a(href=`/r/${subreddit}?sort=${sortQuery}&view=card`) card
6364 if posts
65 each child in posts.posts
+4
src/views/post-search.pug
···2include ../mixins/header
3include ../mixins/head
4005doctype html
6html
7 +head("search posts")
···14 form(action="/post-search" method="get").search-bar
15 - var prefill = original_query ?? "";
16 input(type="text" name="q" placeholder="type in a search term..." value=prefill required).search-input
0017 button(type="submit").search-button go
18 if message
19 div.search-message
···2include ../mixins/header
3include ../mixins/head
45+- var viewQuery = query && query.view ? query.view : 'compact'
6+- var sortQuery = query && query.sort ? query.sort + (query.t ? '&t=' + query.t : '') : 'hot'
7doctype html
8html
9 +head("search posts")
···16 form(action="/post-search" method="get").search-bar
17 - var prefill = original_query ?? "";
18 input(type="text" name="q" placeholder="type in a search term..." value=prefill required).search-input
19+ input(type="hidden" name="sort" value=sortQuery)
20+ input(type="hidden" name="view" value=viewQuery)
21 button(type="submit").search-button go
22 if message
23 div.search-message
+6
src/views/search.pug
···1include ../mixins/header
2include ../mixins/head
3004doctype html
5html
6 +head("search subreddits")
···14 form(action="/sub-search" method="get").search-bar
15 - var prefill = original_query ?? "";
16 input(type="text" name="q" placeholder="type in a search term..." value=prefill required).search-input
0017 button(type="submit").search-button go
1819 hr
···23 form(action="/post-search" method="get").search-bar
24 - var prefill = original_query ?? "";
25 input(type="text" name="q" placeholder="type in a search term..." value=prefill required).search-input
0026 button(type="submit").search-button go
27 p
28 | you can narrow search results using filters:
···1include ../mixins/header
2include ../mixins/head
34+- var viewQuery = query && query.view ? query.view : 'compact'
5+- var sortQuery = query && query.sort ? query.sort + (query.t ? '&t=' + query.t : '') : 'hot'
6doctype html
7html
8 +head("search subreddits")
···16 form(action="/sub-search" method="get").search-bar
17 - var prefill = original_query ?? "";
18 input(type="text" name="q" placeholder="type in a search term..." value=prefill required).search-input
19+ input(type="hidden" name="sort" value=sortQuery)
20+ input(type="hidden" name="view" value=viewQuery)
21 button(type="submit").search-button go
2223 hr
···27 form(action="/post-search" method="get").search-bar
28 - var prefill = original_query ?? "";
29 input(type="text" name="q" placeholder="type in a search term..." value=prefill required).search-input
30+ input(type="hidden" name="sort" value=sortQuery)
31+ input(type="hidden" name="view" value=viewQuery)
32 button(type="submit").search-button go
33 p
34 | you can narrow search results using filters:
+5-1
src/views/sub-search.pug
···1include ../mixins/header
2include ../mixins/head
3004doctype html
5html
6 +head("search subreddits")
···13 form(action="/sub-search" method="get").search-bar
14 - var prefill = original_query ?? "";
15 input(type="text" name="q" placeholder="type in a search term..." value=prefill required).search-input
0016 button(type="submit").search-button go
17 if message
18 div.search-message
···25 - var isSubbed = subs.includes(subreddit)
26 div.sub-title
27 h3
28- a(href=`/r/${subreddit}`)
29 | r/#{subreddit}
30 div#button-container
31 if isSubbed
···1include ../mixins/header
2include ../mixins/head
34+- var viewQuery = (query && query.view) ? query.view : 'compact'
5+- var sortQuery = (query && query.sort) ? query.sort + (query.t ? '&t=' + query.t : '') : 'hot'
6doctype html
7html
8 +head("search subreddits")
···15 form(action="/sub-search" method="get").search-bar
16 - var prefill = original_query ?? "";
17 input(type="text" name="q" placeholder="type in a search term..." value=prefill required).search-input
18+ input(type="hidden" name="sort" value=sortQuery)
19+ input(type="hidden" name="view" value=viewQuery)
20 button(type="submit").search-button go
21 if message
22 div.search-message
···29 - var isSubbed = subs.includes(subreddit)
30 div.sub-title
31 h3
32+ a(href=`/r/${subreddit}?sort=${sortQuery}&view=${viewQuery}`)
33 | r/#{subreddit}
34 div#button-container
35 if isSubbed
+3-1
src/views/subs.pug
···1include ../mixins/header
2include ../mixins/head
3004doctype html
5html
6 +head("subscriptions")
···16 - var isSubbed = true
17 div.sub-title
18 h4
19- a(href=`/r/${subreddit}`)
20 | r/#{subreddit}
21 div#button-container
22 if isSubbed