V
V
Vyacheslav Lebedev2015-04-23 15:19:41
Pug
Vyacheslav Lebedev, 2015-04-23 15:19:41

How to understand api jade?

Good afternoon!
I can’t figure out api jade, I look at the doc and all the examples are too meager for simpler examples.
In general, I want to write a template on node, into which several variables will be inserted (compiled on the server side) and given to the browser.
And if you have a good article on jade api in mind, I will also be grateful if you drop it :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2015-04-23
@slavikse

So here it is, much easier:

var jade = require('jade');

// Compile a function
var fn = jade.compileFile('path to jade file', options);

// Render the function
var html = fn(locals);

What exactly is unclear?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question