selfhostable, read-only reddit client

add urls to open comments and submissions externally

Changed files
+28 -15
src
mixins
public
views
+2 -2
flake.nix
··· 80 80 81 81 copyToRoot = final.buildEnv { 82 82 name = "image-root"; 83 - paths = [ final.lurker ]; 84 - pathsToLink = [ "/bin" ]; 83 + paths = [final.lurker]; 84 + pathsToLink = ["/bin"]; 85 85 }; 86 86 87 87 runAsRoot = ''
+16 -13
src/mixins/comment.pug
··· 2 2 3 3 mixin infoContainer(data, next_id, prev_id) 4 4 div.comment-info-container 5 - | #{fmtnum(data.ups)} ↑ 6 - | ·  7 - if next_id 8 - a(href=`#${next_id}`).nav-link next 5 + p 6 + | #{fmtnum(data.ups)} ↑ 7 + | ·  8 + if next_id 9 + a(href=`#${next_id}` title="scroll to next comment").nav-link next 10 + |  ·  11 + if prev_id 12 + a(href=`#${prev_id}` title="scroll to previous comment").nav-link prev 13 + |  ·  14 + span(class=`${data.is_submitter ? 'op' : ''}`) 15 + | u/#{data.author} #{data.is_submitter ? '(op)' : ''} 9 16 |  ·  10 - if prev_id 11 - a(href=`#${prev_id}`).nav-link prev 12 - |  ·  13 - span(class=`${data.is_submitter ? 'op' : ''}`) 14 - | u/#{data.author} #{data.is_submitter ? '(op)' : ''} 15 - |  ·  16 - if data.collapsed_reason_code == "DELETED" 17 - a(href=`https://undelete.pullpush.io${data.permalink}`) search on undelete 17 + if data.collapsed_reason_code == "DELETED" 18 + a(href=`https://undelete.pullpush.io${data.permalink}`) search on undelete 19 + |  ·  20 + | #{timeDifference(Date.now(), data.created * 1000)} 18 21 |  ·  19 - | #{timeDifference(Date.now(), data.created * 1000)} 22 + a(href=`https://reddit.com${data.permalink}` title="view on reddit").nav-link open ↗ 20 23 21 24 - 22 25 function hasReplies(data) {
+4
src/public/styles.css
··· 579 579 a.nav-link { 580 580 color: var(--text-color-muted); 581 581 } 582 + 583 + .comment-info-container > p { 584 + margin-top: 0px; 585 + }
+6
src/views/comments.pug
··· 25 25 a(href=`/r/${post.subreddit}`) ← r/#{post.subreddit} 26 26 27 27 div.info-container 28 + - var domain = (new URL(post.url)).hostname 28 29 p 29 30 | #{fmtnum(post.ups)} ↑ 30 31 |  ·  by u/#{post.author} 31 32 |  ·  32 33 | #{timeDifference(Date.now(), post.created * 1000)} 34 + |  ·  35 + if domain !== 'www.reddit.com' 36 + a(href=`${post.url}`) submission url ↗ 37 + |  ·  38 + a(href=`https://reddit.com${post.permalink}`) reddit ↗ 33 39 34 40 h2.post-title 35 41 != post.title