I have a layout.jade
that looks like this:
html
body
block content
block footer
My content.jade
looks like that:
extends layout
block content
#Content Welcome
My footer.jade
looks like that:
extends layout
block footer
#Footer Impressum
Now, when I run my app
like that:
app.get('/', function(req, res) {
res.render('layout');
});
I do not see neither the content nor the footer.
When I run:
app.get('/', function(req, res) {
res.render('content');
});
Then I see the content.
When I run:
app.get('/', function(req, res) {
res.render('footer');
});
Then I see the footer.
How can I see both, content and footer?
You probably want something like this:
layout.jade
html
body
block content
include footer
pagename.jade
extends layout
block content
h1 My Content
footer.jade
p.footer Here is my footer
Then run res.render('pagename');
.
Unless you want to have specific stuff in your footer per page, there's no point in making it a block.
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