Skip to content

Commit 463a22d

Browse files
author
codingChewie
committed
Breaking Your Project’s Templates into Partials
1 parent ab31b0b commit 463a22d

File tree

5 files changed

+27
-25
lines changed

5 files changed

+27
-25
lines changed

views/card.pug

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
doctype html
2-
html(lang="en")
3-
head
4-
title Flash Cards
5-
body
6-
header
7-
h1 Flash Cards
8-
section#content
9-
h2= prompt
10-
if hint
11-
p
12-
i Hint: #{hint}
13-
footer
14-
p An app to help you stufy
1+
extends layout.pug
2+
3+
block content
4+
section#content
5+
h2= prompt
6+
if hint
7+
p
8+
i Hint: #{hint}
9+

views/includes/footer.pug

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
footer
2+
p An app to help you stufy

views/includes/header.pug

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
header
2+
h1 Flash Cards

views/index.pug

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
doctype html
2-
html(lang="en")
3-
head
4-
title Flash Cards
5-
body
6-
header
7-
h1 Flash Cards
8-
section#content
9-
h2 Welcome, student
10-
footer
11-
p An app to help you stufy
1+
extends layout.pug
2+
3+
block content
4+
section#content
5+
h2 Welcome, student
6+

views/layout.pug

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
doctype html
2+
html(lang="en")
3+
head
4+
title Flash Cards
5+
body
6+
include includes/header.pug
7+
block content
8+
include includes/footer.pug

0 commit comments

Comments
 (0)