Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
- What is Template Rendering? 2:35
- Review: What is Template Rendering 5 questions
- What is Pug? 3:00
- Using Pug in Your Express App 4:53
- Review: Pug Basics 5 questions
- Express’s Response.render Method 7:42
- Review Response.render 2 objectives
- Using Logic in Pug 6:12
- Breaking Your Project’s Templates into Partials 7:29
- Review: Pug Inheritance & Logic 5 questions

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Pug templates can contain logic you can use to make them more versatile. You can show or hide parts of the page conditionally, or iterate over arrays of data to express tables or lists more concisely.
Snippet Used in the Video
const colors = [
'red',
'orange',
'yellow',
'green',
'blue',
'purple'
];
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Wendy Cortes
Full Stack JavaScript Techdegree Graduate 16,375 Points1 Answer
-
karan Badhwar
Web Development Techdegree Graduate 18,135 Points1 Answer
-
Mark Westerweel
Full Stack JavaScript Techdegree Graduate 22,378 Points1 Answer
-
amro
5,773 PointsUsing Logic in Pug
Posted by amroamro
5,773 Points2 Answers
-
Michael Pashkov
22,024 Points1 Answer
-
Kevin Ohlsson
4,559 Points1 Answer
-
Mary Paul
13,792 PointsCannot get colors array to render, "property length undefined".
Posted by Mary PaulMary Paul
13,792 Points5 Answers
-
Cory Wallace
14,313 Points2 Answers
-
Akash Sharma
Full Stack JavaScript Techdegree Student 14,147 Points2 Answers
-
Rashid Mikati
2,163 Points1 Answer
-
Kajetan Mazur
2,467 Points2 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up