From 5035c815b282d3c9bbe7c98aee47d68fe1965415 Mon Sep 17 00:00:00 2001 From: dev-rajneeshkumar Date: Thu, 7 Nov 2024 11:58:58 +0530 Subject: [PATCH 1/2] merge blog and articles --- blocks/card-list/card-list.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/blocks/card-list/card-list.js b/blocks/card-list/card-list.js index 5cc49a892..9deeb77a4 100644 --- a/blocks/card-list/card-list.js +++ b/blocks/card-list/card-list.js @@ -246,9 +246,29 @@ const VARIANTS = { cardRenderer: blogCardRender, async getData() { - return ffetch('/query-index.json') + let data = []; + const publications = await ffetch('/query-index.json') + .sheet('publications') + .filter((resource) => resource.publicationType === 'Full Article') + .all(); + + const blogs = await ffetch('/query-index.json') .sheet('blog') .all(); + + data = [...publications, ...blogs]; + + data.sort((x, y) => { + if (x.date > y.date) { + return -1; + } + if (x.date < y.date) { + return 1; + } + return 0; + }); + + return data; }, getCategories(item) { From 7a55e006dbf19e70b34379bb6937ad2043488530 Mon Sep 17 00:00:00 2001 From: bluedeepart Date: Thu, 7 Nov 2024 13:14:31 +0530 Subject: [PATCH 2/2] updated filter base from url to category type --- blocks/breadcrumbs/breadcrumbs.css | 4 ++-- blocks/card-list/card-list.js | 11 +---------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/blocks/breadcrumbs/breadcrumbs.css b/blocks/breadcrumbs/breadcrumbs.css index 951a0a97b..9954956fe 100644 --- a/blocks/breadcrumbs/breadcrumbs.css +++ b/blocks/breadcrumbs/breadcrumbs.css @@ -6,8 +6,8 @@ } .news main .breadcrumbs, -.publication main .breadcrumbs, -.events main .breadcrumbs { +.events main .breadcrumbs, +.publication:not(.full-article) main .breadcrumbs { padding-top: 70px; } diff --git a/blocks/card-list/card-list.js b/blocks/card-list/card-list.js index 9deeb77a4..254bdb055 100644 --- a/blocks/card-list/card-list.js +++ b/blocks/card-list/card-list.js @@ -272,16 +272,7 @@ const VARIANTS = { }, getCategories(item) { - const category = item.path - .split('/')[2]; - - if (!category || category === 'blog') return null; - - const filterableCategory = category.split('-') - .map((s) => s.charAt(0).toUpperCase() + s.slice(1).toLowerCase()) - .join('-'); - - return [filterableCategory]; + return [item.category || item.Category]; }, },