Chapter 7. Web application templating

 

This chapter covers

  • Organizing applications with templating
  • Creating templates by using Embedded JavaScript
  • Learning minimalist templating with Hogan
  • Using Pug to create templates

In chapters 3 and 6, you learned some basics about templates in Express applications in order to create views. In this chapter, you’ll focus exclusively on templating, learning how to use three popular template engines, and how to use templating to keep any web application’s code clean by separating logic from presentation markup.

If you’re familiar with templating and the Model-View-Controller (MVC) pattern, you can skim through to section 7.2, where you’ll start learning about the template engines detailed in this chapter, which include Embedded JavaScript, Hogan, and Pug. If you’re not familiar with templating, keep reading—you’ll explore it conceptually in the next few sections.

7.1. Using templating to keep code clean

 
 
 
 

7.2. Templating with Embedded JavaScript

 

7.3. Using the Mustache templating language with Hogan

 
 
 
 

7.4. Templating with Pug

 
 
 
 

7.5. Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest