Skip to content

Commit d99d59d

Browse files
committed
some minor layout stuff
1 parent e49d034 commit d99d59d

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ app.set('views', './views');
99
app.set('view engine', 'pug');
1010

1111
app.get('/', (req, res) => {
12-
res.render('index');
12+
res.render('index', { home: true });
1313
});
1414

1515
app.get(/.*/, (req, res) => {

views/404.pug

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
extends layout.pug
33

44
block content
5-
h1 rdenn.is
6-
h2 404
5+
h1 404
76
p There is nothing here

views/index.pug

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
extends layout.pug
33

44
block content
5-
h1 rdenn.is
5+
h1 Welcome!
66
p.
77
Welcome to my personal website. I'll be putting stuff here in the future.

views/layout.pug

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
11
//- layout.pug
2+
- var showEnv = typeof env === 'string' && env !== 'production'
3+
4+
mixin linkOrDiv(anchor, href)
5+
div&attributes(attributes)
6+
if anchor
7+
a(href=href)&attributes(attributes)
8+
block
9+
else
10+
block
11+
212
doctype html
313
html(lang="en")
414
head
515
block title
616
title rdenn.is
717
if title && title.trim && title.trim()
818
| - #{title}
9-
if typeof env === 'string' && env !== 'production'
19+
if showEnv
1020
| : #{env}
1121
block styles
1222
block head-scripts
1323
body
24+
header
25+
+linkOrDiv(!home, '/')(class='home')
26+
| rdenn.is
27+
if showEnv
28+
| : #[span.env #{env}]
1429
block content
1530
block body-scripts

0 commit comments

Comments
 (0)