Tutorial by Examples

Before to launch you to code with Pug, you need to have some prerequisits. You will need to install: NodeJS with NPM ExpressJS (optional) After installing NodeJS, you can check in your terminal the correct installation doing: $ node -v If successful, it will print the number of Node's ve...
Pug (old name is Jade) is a clean, whitespace sensitive syntax for writing HTML. Here is a simple example: doctype html html(lang="en") head title= pageTitle script(type='text/javascript'). if (foo) bar(1 + 5) body h1 Pug - node template engine #container...
var pug = require('pug'); // compile var fn = pug.compile('string of pug', options); var html = fn(locals); // render var html = pug.render('string of pug', merge(options, locals)); // renderFile var html = pug.renderFile('filename.pug', merge(options, locals)); Options filename U...

Page 1 of 1