This commit is contained in:
2025-10-07 12:12:51 -05:00
parent 3904c00114
commit 38aab95444

View File

@@ -80,9 +80,12 @@ const renderTemplate = async (
const pageFile = path.join(viewsDir, "pages", `${template}.ejs`); const pageFile = path.join(viewsDir, "pages", `${template}.ejs`);
const layoutFile = path.join(viewsDir, "layouts", "layout.ejs"); const layoutFile = path.join(viewsDir, "layouts", "layout.ejs");
const body = await ejs.renderFile(pageFile, locals, { async: true }); const body = await ejs.renderFile(pageFile, locals, { async: true });
const defaultTitle = `${
locals.appName ?? pkg.name ?? "Amayo Bot"
} | Guía Completa`;
const html = await ejs.renderFile( const html = await ejs.renderFile(
layoutFile, layoutFile,
{ ...locals, body }, { ...locals, title: locals.title ?? defaultTitle, body },
{ async: true } { async: true }
); );
res.writeHead(statusCode, { res.writeHead(statusCode, {