Skip to content

Commit ab31b0b

Browse files
author
codingChewie
committed
Using Logic in Pug
1 parent 3371d29 commit ab31b0b

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

app.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ app.get('/cards', (req, res) => {
1414

1515
res.render('card', {
1616
prompt: `Who is buried in Grant's tomb?`,
17-
hint: `Think about whose tomb it is?`,
1817
})
1918
})
2019

logic.pug

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
doctype html
2+
html(lang="en")
3+
head
4+
title Logic
5+
body
6+
header
7+
h1 Logic
8+
section#content
9+
10+
ul
11+
each color in colors
12+
li= color
13+
14+
if hint
15+
p
16+
i Hint: #{hint}
17+
else
18+
p
19+
i (Nothing to display)
20+

views/card.pug

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ html(lang="en")
77
h1 Flash Cards
88
section#content
99
h2= prompt
10-
p
11-
i Hint: #{hint}
10+
if hint
11+
p
12+
i Hint: #{hint}
1213
footer
1314
p An app to help you stufy

0 commit comments

Comments
 (0)