I am trying to give context through express route to pug file containing only one mixin. But when i try to render that file, it just do nothing.
This is my express route
app.post('/comment', (req, res) => {
const test = {
text: 'working',
};
res.render('comment-section', test);
});
And here is my pug file mixin
mixin comment()
div.comment-content
div.row
div.col-lg-1
a(href="#")
img(src="img/default_profile.jpg").comment-profile-img
div.col-lg-10
p.user-comment
| Comment //- <--- Here i would like to use the test object this way {#text}
div
textarea(name="post_content" placeholder="Comment something" rows="1").comment-textarea.post-comment-message
How can i make the pug mixin take the context (test object) from the route and use it. Thanks in advance!