Skip to content

Commit

Permalink
Minor Change wrt to breadcrumbtitle
Browse files Browse the repository at this point in the history
  • Loading branch information
piyushjindal committed Sep 21, 2023
1 parent 77cd65e commit 6bd2642
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 9 additions & 0 deletions tools/importer/import-news-press-healthythinking.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
9 changes: 0 additions & 9 deletions tools/importer/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 6bd2642

Please sign in to comment.