Customer experience — what it is, why it’s important, and how to deliver it
-See what Adobe Experience Cloud can do for you. Request a demo today.
- -diff --git a/blog/scripts/utils.js b/blog/scripts/utils.js index 5f0ab42..1ae323e 100644 --- a/blog/scripts/utils.js +++ b/blog/scripts/utils.js @@ -61,27 +61,6 @@ function buildBlock(blockName, content) { return (blockEl); } -function buildTagsBlock() { - const metadata = document.head.querySelectorAll('meta[property="article:tag"]'); - if (!metadata.length) return; - const tagsArray = [...metadata].map((el) => el.content); - const tagsBlock = buildBlock('tags', tagsArray.join(', ')); - const main = document.querySelector('main'); - const recBlock = main.querySelector('.recommended-articles'); - - if (!recBlock) { - main.lastElementChild.append(tagsBlock); - return; - } - - // Put tags block before recommended articles block - if (recBlock.parentElement.childElementCount === 1) { - recBlock.parentElement.previousElementSibling.append(tagsBlock); - } else { - recBlock.before(tagsBlock); - } -} - function getImageCaption(picture) { // Check if the parent element has a caption const parentEl = picture.parentNode; @@ -99,24 +78,18 @@ function getImageCaption(picture) { async function buildArticleHeader(el) { const miloLibs = getLibs(); const { getMetadata, getConfig } = await import(`${miloLibs}/utils/utils.js`); - const { loadTaxonomy, getLinkForTopic, getTaxonomyModule } = await import(`${miloLibs}/blocks/article-feed/article-helpers.js`); - if (!getTaxonomyModule()) { - await loadTaxonomy(); - } const div = document.createElement('div'); const h1 = el.querySelector('h1'); const picture = el.querySelector('picture'); const caption = getImageCaption(picture); const figure = document.createElement('div'); figure.append(picture, caption); - const category = getMetadata('category'); const author = getMetadata('author') || 'Adobe Communications Team'; const { locale } = getConfig(); const authorURL = getMetadata('author-url') || (author ? `${locale.contentRoot}/authors/${author.replace(/[^0-9a-z]/gi, '-').toLowerCase()}` : null); const publicationDate = getMetadata('publication-date'); - const categoryTag = getLinkForTopic(category); const articleHeaderBlockEl = buildBlock('article-header', [ - [`
${categoryTag}
`], + [''], [h1], [`${authorURL ? `${author}` : author}
${publicationDate}
`], @@ -132,7 +105,6 @@ export async function buildAutoBlocks() { const mainEl = document.querySelector('main'); try { if (getMetadata('publication-date') && !mainEl.querySelector('.article-header')) { - buildTagsBlock(mainEl); await buildArticleHeader(mainEl); } } catch (error) { diff --git a/test/scripts/mocks/tagsHead.html b/test/scripts/mocks/tagsHead.html deleted file mode 100644 index f869b4e..0000000 --- a/test/scripts/mocks/tagsHead.html +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/test/scripts/mocks/tagsWithRecBody.html b/test/scripts/mocks/tagsWithRecBody.html deleted file mode 100644 index 8eaf8e2..0000000 --- a/test/scripts/mocks/tagsWithRecBody.html +++ /dev/null @@ -1,15 +0,0 @@ -See what Adobe Experience Cloud can do for you. Request a demo today.
- -See what Adobe Experience Cloud can do for you. Request a demo today.
-