diff --git a/lib/util.ts b/lib/util.ts index b9494c3..eae94c7 100644 --- a/lib/util.ts +++ b/lib/util.ts @@ -75,12 +75,18 @@ export function video(metadata: Metadata, name: string, attributes: object): str `; } +const domain = process.env.DOMAIN; + export function render(template: string, data: any, filename?: string): string { - data.require = require; - data.fancyLink = fancyLink; - data.formatDate = formatDate; - data.video = video; - return ejs.render(template, data, { + const newData = { + require, + fancyLink, + formatDate, + video, + domain, + ...data, + }; + return ejs.render(template, newData, { filename }); } diff --git a/site/layouts/default.html.ejs b/site/layouts/default.html.ejs index 9aceb8b..52b33cf 100644 --- a/site/layouts/default.html.ejs +++ b/site/layouts/default.html.ejs @@ -7,8 +7,8 @@