Skip to content

Commit

Permalink
MWPW-129907 - Blog Migration (#741)
Browse files Browse the repository at this point in the history
Fixed taxonomy categry default.

Resolves: MWPW-129907

Co-authored-by: Ryan Clayton <rclayton@adobe.com>
Co-authored-by: Okan Sahin <39759830+mokimo@users.noreply.github.com>
  • Loading branch information
3 people authored May 19, 2023
1 parent 1df50e1 commit d272636
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libs/blocks/featured-article/featured-article.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default async function init(el) {

// load taxonomy to get link of article "category"
const taxonomy = await fetchTaxonomy(getConfig(), '/topics');
const categoryTaxonomy = taxonomy.get(category);
const categoryTaxonomy = taxonomy.get(category) || 'News';

const pic = doc.body.querySelector('picture');
const featuredImg = createTag('div', { class: 'featured-article-card-image' }, pic);
Expand Down
2 changes: 1 addition & 1 deletion libs/blocks/recommended-articles/recommended-articles.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function getDecoratedCards(articles, taxonomy) {
const wrapper = createTag('a', { class: 'article-card', href: path });
const cardImage = createTag('div', { class: 'article-card-image' }, imageEl);
const cardBody = createTag('div', { class: 'article-card-body' });
const categoryTaxonomy = taxonomy.get(category || 'News');
const categoryTaxonomy = taxonomy.get(category) || 'News';
const categoryLink = createTag('a', { href: categoryTaxonomy.link }, categoryTaxonomy.name);
const categoryEl = createTag('p', { class: 'article-card-category' }, categoryLink);
const titleEl = createTag('h3', null, title);
Expand Down

0 comments on commit d272636

Please sign in to comment.