Where does express get the default value for its title variable. My index.jade looks like the following:
h1= title
p Welcome to #{title}
I don't quite understand where the title variable is set.
In your routes/index.js you will be saying
res.render('index', { title: 'Express' });
So here it will find views/index.jade put value of title variable as 'Express'.
You can say in your jade
p Welcome to #{title} from #{name}
and while renderring
res.render('index', { title: 'Express' ,name: 'myName'});
it will be converted in Welcome to Express from myName.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With