aboutsummaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
Diffstat (limited to 'src/views')
-rw-r--r--src/views/home.pug13
-rw-r--r--src/views/index.pug13
2 files changed, 21 insertions, 5 deletions
diff --git a/src/views/home.pug b/src/views/home.pug
new file mode 100644
index 0000000..87f6e0a
--- /dev/null
+++ b/src/views/home.pug
@@ -0,0 +1,13 @@
1include ../mixins/sub
2doctype html
3html
4 +subMgmt()
5 script(async).
6 window.addEventListener("load", () => {
7 const url = `/r/${getSubs().join('+')}`;
8 if (url) {
9 window.location.href = url;
10 } else {
11 window.location.href = '/r/all';
12 }
13 });
diff --git a/src/views/index.pug b/src/views/index.pug
index add4c8e..f7f67b9 100644
--- a/src/views/index.pug
+++ b/src/views/index.pug
@@ -8,7 +8,7 @@ doctype html
8html 8html
9 +head() 9 +head()
10 +subMgmt() 10 +subMgmt()
11 script. 11 script(defer).
12 function updateButton(sub) { 12 function updateButton(sub) {
13 var b = document.getElementById("button-container"); 13 var b = document.getElementById("button-container");
14 b.innerHTML = ''; 14 b.innerHTML = '';
@@ -36,13 +36,16 @@ html
36 body 36 body
37 main#content 37 main#content
38 +header() 38 +header()
39
40 div.hero 39 div.hero
41 div.sub-title 40 div.sub-title
42 h1 41 h1
43 a(href=`/r/${subreddit}`) 42 if isMulti
44 | r/#{subreddit} 43 a(href=`/`) readit
45 div#button-container 44 else
45 a(href=`/r/${subreddit}`)
46 | r/#{subreddit}
47 if !isMulti
48 div#button-container
46 if about 49 if about
47 p #{about.public_description} 50 p #{about.public_description}
48 details 51 details