diff options
author | Akshay <[email protected]> | 2024-11-03 18:03:41 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2024-11-03 18:03:41 +0000 |
commit | db4adf16520dfdeae250780b14cc14f3900dba70 (patch) | |
tree | 39b3972beffb1bb1a2e618802f5259bf9937c297 | |
parent | 13589cb7a024efaa51e9efbce5b4e8ad7475d448 (diff) |
fix annoyingly oversized link
a > h1 results in big text, big link, h1 > a, results in big text, small
link, and keeps people with fat thumbs happy
-rw-r--r-- | src/routes/index.js | 6 | ||||
-rw-r--r-- | src/views/index.pug | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/routes/index.js b/src/routes/index.js index f7a0425..54a5b18 100644 --- a/src/routes/index.js +++ b/src/routes/index.js | |||
@@ -14,9 +14,11 @@ router.get('/', async (req, res) => { | |||
14 | router.get('/r/:subreddit', async (req, res) => { | 14 | router.get('/r/:subreddit', async (req, res) => { |
15 | var subreddit = req.params.subreddit; | 15 | var subreddit = req.params.subreddit; |
16 | var query = req.query? req.query : {}; | 16 | var query = req.query? req.query : {}; |
17 | var sort = query.sort? query.sort : 'hot'; | 17 | if (!query.sort) { |
18 | query.sort = 'hot'; | ||
19 | } | ||
18 | 20 | ||
19 | var postsReq = G.getSubmissions(sort, `${subreddit}`, query); | 21 | var postsReq = G.getSubmissions(query.sort, `${subreddit}`, query); |
20 | var aboutReq = G.getSubreddit(`${subreddit}`); | 22 | var aboutReq = G.getSubreddit(`${subreddit}`); |
21 | 23 | ||
22 | var [posts, about] = await Promise.all([postsReq, aboutReq]); | 24 | var [posts, about] = await Promise.all([postsReq, aboutReq]); |
diff --git a/src/views/index.pug b/src/views/index.pug index 01b2941..f506c09 100644 --- a/src/views/index.pug +++ b/src/views/index.pug | |||
@@ -44,13 +44,14 @@ html | |||
44 | 44 | ||
45 | div.hero | 45 | div.hero |
46 | div.sub-title | 46 | div.sub-title |
47 | a(href=`/r/${subreddit}`) | 47 | h1 |
48 | h1 r/#{subreddit} | 48 | a(href=`/r/${subreddit}`) |
49 | | r/#{subreddit} | ||
49 | div#button-container | 50 | div#button-container |
50 | if about | 51 | if about |
51 | p #{about.public_description} | 52 | p #{about.public_description} |
52 | details | 53 | details |
53 | summary sort by | 54 | summary sorting by #{query.sort + (query.t?' '+query.t:'')} |
54 | div.sort-opts | 55 | div.sort-opts |
55 | a(href=`/r/${subreddit}?sort=hot`) hot | 56 | a(href=`/r/${subreddit}?sort=hot`) hot |
56 | a(href=`/r/${subreddit}?sort=new`) new | 57 | a(href=`/r/${subreddit}?sort=new`) new |