From c775486315a504478d0acb6b9138e80bd0807bb0 Mon Sep 17 00:00:00 2001 From: rgravitvl Date: Wed, 11 Dec 2024 19:17:30 +0530 Subject: [PATCH] Minor update for wsaw --- blocks/card-list/card-list.js | 8 ++++---- helix-query.yaml | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/blocks/card-list/card-list.js b/blocks/card-list/card-list.js index d49138d9..b268ae15 100644 --- a/blocks/card-list/card-list.js +++ b/blocks/card-list/card-list.js @@ -9,7 +9,7 @@ import createApplicationCard from './applicationCard.js'; import { makePublicUrl } from '../../scripts/scripts.js'; import { buildItemListSchema } from '../../scripts/schema.js'; -const tagName = getMetadata('template') === 'wsaw' ? 'solutions' : 'topics'; +const tagName = getMetadata('template') === 'wsawHub' ? 'solutions' : 'topics'; const getSelectionFromUrl = () => (window.location.pathname.indexOf(tagName) > -1 ? toClassName(window.location.pathname.replace('.html', '').split('/').pop()) : ''); const getPageFromUrl = () => toClassName(new URLSearchParams(window.location.search).get('page')) || ''; @@ -147,16 +147,16 @@ export function createFilters(articles, viewAll = false) { } export default async function decorate(block) { + block.setAttribute('id', 'card-list'); const articleType = block.classList.length > 2 ? block.classList[1] : ''; if (articleType) block.classList.remove(articleType); block.textContent = ''; + const indexType = getMetadata('template') === 'wsawHub' ? 'wsaw' : 'article'; - const indexType = getMetadata('template') === 'wsaw' ? 'wsaw' : 'article'; - const contentType = getMetadata('template') === 'wsaw' ? 'weseeaway' : articleType; // fetch and sort all articles const articles = await ffetch(`/us/en/${indexType}-index.json`) .chunks(500) - .filter(({ type }) => type.toLowerCase() === contentType) + .filter(({ type }) => type.toLowerCase() === articleType) .filter((article) => !article.path.includes('/topics-template')) .all(); let filteredArticles = articles; diff --git a/helix-query.yaml b/helix-query.yaml index ce55588f..403c7410 100644 --- a/helix-query.yaml +++ b/helix-query.yaml @@ -85,6 +85,8 @@ indices: wsaw: include: - /us/en/we-see-a-way/** + exclude: + - /us/en/we-see-a-way target: /us/en/wsaw-index.json properties: lastModified: