From ed687b9f4554f4b8587de0bfda592932c2ce5231 Mon Sep 17 00:00:00 2001 From: Megan Thomas Date: Tue, 17 Sep 2024 11:36:43 -0700 Subject: [PATCH] MWPW-144470 Remove author link from article header (#65) --- blog/scripts/utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blog/scripts/utils.js b/blog/scripts/utils.js index 32afb0c..f0e9e86 100644 --- a/blog/scripts/utils.js +++ b/blog/scripts/utils.js @@ -64,7 +64,7 @@ function buildBlock(blockName, content) { function getImageCaption(picture) { // Check if the parent element has a caption const parentEl = picture.parentNode; - let caption = parentEl.querySelector('em'); + const caption = parentEl.querySelector('em'); if (caption) return caption; // If the parent element doesn't have a caption, check if the next sibling does @@ -72,6 +72,7 @@ function getImageCaption(picture) { if (!parentSiblingEl || !parentSiblingEl.querySelector('picture')) return ''; const firstChildEl = parentSiblingEl.firstChild; if (firstChildEl?.tagName === 'EM') return firstChildEl; + return ''; } async function buildArticleHeader(el) { @@ -90,7 +91,7 @@ async function buildArticleHeader(el) { const articleHeaderBlockEl = buildBlock('article-header', [ ['

'], [h1], - [`

${authorURL ? `${author}` : author}

+ [`

${author}

${publicationDate}

`], [figure], ]);