From 6bd264204ebcde7171bdb6dea027cbdec1ce345a Mon Sep 17 00:00:00 2001 From: piyushjindal Date: Thu, 21 Sep 2023 11:25:21 +0530 Subject: [PATCH] Minor Change wrt to breadcrumbtitle --- tools/importer/import-news-press-healthythinking.js | 9 +++++++++ tools/importer/utils.js | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/importer/import-news-press-healthythinking.js b/tools/importer/import-news-press-healthythinking.js index 73923ada..ffcfddbe 100644 --- a/tools/importer/import-news-press-healthythinking.js +++ b/tools/importer/import-news-press-healthythinking.js @@ -172,6 +172,15 @@ export default { } } + const sectionBreadcrumb = document.querySelector('.section-breadcrumb'); + if (sectionBreadcrumb) { + const breadcrumbItems = sectionBreadcrumb.querySelectorAll('.ss-breadcrumb .breadcrumb-item'); + if (breadcrumbItems && breadcrumbItems.length) { + const breadcrumbText = breadcrumbItems[breadcrumbItems.length - 1].textContent.trim(); + metadataDetails.BreadcrumbTitle = breadcrumbText; + } + } + if (pathname.includes('/newsroom/')) { metadataDetails.Category = 'Newsroom'; diff --git a/tools/importer/utils.js b/tools/importer/utils.js index 4d59fede..a713869a 100644 --- a/tools/importer/utils.js +++ b/tools/importer/utils.js @@ -20,15 +20,6 @@ export const createMetadata = (main, document, params) => { meta.Image = el; } - const breadcrumb = document.querySelector('.section-breadcrumb'); - if (breadcrumb) { - const breadcrumbItems = breadcrumb.querySelectorAll('.ss-breadcrumb .breadcrumb-item'); - if (breadcrumbItems && breadcrumbItems.length) { - const breadcrumbText = breadcrumbItems[breadcrumbItems.length - 1].textContent.trim(); - meta.BreadcrumbTitle = breadcrumbText; - } - } - if (params.preProcessMetadata && Object.keys(params.preProcessMetadata).length) { Object.assign(meta, params.preProcessMetadata); }