From d0c5e3ba685a0c826fb743c3d78e66915399e326 Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Mon, 23 Jun 2025 13:07:56 +0300 Subject: [PATCH] Allow mutation of guide template for HTML unescaping (#8816) Signed-off-by: Emmanuel Ferdman --- scripts/generate-og-images.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/generate-og-images.mjs b/scripts/generate-og-images.mjs index e1f0ed087..cb90c212b 100644 --- a/scripts/generate-og-images.mjs +++ b/scripts/generate-og-images.mjs @@ -241,19 +241,19 @@ async function generateGuideOpenGraph() { const image = author?.imageUrl || 'https://roadmap.sh/images/default-avatar.png'; const isExternalImage = image?.startsWith('http'); - let authorImageExtention = ''; + let authorImageExtension = ''; let authorAvatar; if (!isExternalImage) { authorAvatar = await fs.readFile(path.join(ALL_AUTHOR_IMAGE_DIR, image)); - authorImageExtention = image?.split('.')[1]; + authorImageExtension = image?.split('.')[1]; } - const template = getGuideTemplate({ + let template = getGuideTemplate({ ...guide, authorName: author.name, authorAvatar: isExternalImage ? image - : `data:image/${authorImageExtention};base64,${authorAvatar.toString('base64')}`, + : `data:image/${authorImageExtension};base64,${authorAvatar.toString('base64')}`, }); if ( hasSpecialCharacters(guide.title) ||