Closed mikayelyan closed 1 year ago
Node.js version: v16.13.1
OS version: Ubuntu 20.04.5 LTS (Focal Fossa)
Description: Unable to reuse block code (layouts) when using pug engine.
pug
Result
Test Email
Test Email hello world
const templatesPath = path.join(__dirname, '..', 'templates'); const email = new Email({ message: { from: process.env.EMAIL_USER, }, views: { root: templatesPath, }, send: true, transport: transporter, });
const sendEmail = async (template, recipients, data) => { const recipientList = IS_PRODUCTION ? recipients : getMockRecipients(recipients); try { const result = await email.send({ template, message: { to: recipientList }, locals: data, }); log.info(result); } catch (err) { log.error(err); throw err; } };
Templates file structure. app.js
html.pug
p Test Email block content
hello.pug
extends html block content p hello world
Actually, it works. Here I shouldn't use extends/block but just need to include the file we need. (or use mixins, which also works fine)
extends/block
p Test Email include hello.pug
Describe the bug
Node.js version: v16.13.1
OS version: Ubuntu 20.04.5 LTS (Focal Fossa)
Description: Unable to reuse block code (layouts) when using
pug
engine.Actual behavior
Result
Expected behavior
Result
Code to reproduce
Templates file structure. app.js
html.pug
hello.pug
Checklist