node.js - Using a global wrapper template in Express/Jade -


i've had quick skim of jade documentation , can't seem figure out how apply wrapper templates output.

how done?

it sounds want template inheritance:

// layout.jade !!!5 html   body     block content 

the content block define in templates going inherit layout template:

// index.jade extends layout  block content   h1 hello world! 

when render index.jade, result:

<!doctype html> <html>   <body>     <h1>hello world!</h1>   </body> </html> 

so in layout.jade, set common elements js/css, headers/footers, etc.


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -