Skip to content

Commit

Permalink
Updated the content type
Browse files Browse the repository at this point in the history
  • Loading branch information
rgravitvl committed Dec 11, 2024
1 parent a893675 commit c23b15e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blocks/card-list/card-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,11 @@ export default async function decorate(block) {
block.textContent = '';

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() === articleType)
.filter(({ type }) => type.toLowerCase() === contentType)
.filter((article) => !article.path.includes('/topics-template'))
.all();
let filteredArticles = articles;
Expand Down

0 comments on commit c23b15e

Please sign in to comment.