Jade - Loading templates from different directories
You can use variable __dirname
to connect views from other directories.
Example:
app.get('/otherurl/' , (req, res) => {
res.render(`${__dirname}/../other_project/views/index`)
});
It looks like I had to just give the relative path in the extends
call.
extends ../../../views/layout
block content
form(action='/sessions', method='post')
label
| Username
input(type='text', name='user')
label
| Password
input(type='password', name='password')
input(type='submit', name='Submit')
I didn't have to set app.set('view options',{layout:false});