From 2d4a1ee96bb86674de4fc26a28bbf8b33a3eddbc Mon Sep 17 00:00:00 2001 From: Ryan Clayton Date: Wed, 13 Sep 2023 19:27:05 -0600 Subject: [PATCH] [Blog Migration] Article feed update to work with metadata (#1261) Article feed update to work with langroot Co-authored-by: Ryan Clayton --- libs/blocks/article-feed/article-feed.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/blocks/article-feed/article-feed.js b/libs/blocks/article-feed/article-feed.js index 57cd44f16f..761c49aea7 100644 --- a/libs/blocks/article-feed/article-feed.js +++ b/libs/blocks/article-feed/article-feed.js @@ -8,6 +8,7 @@ import { import { createTag, getConfig, createIntersectionObserver } from '../../utils/utils.js'; import { replaceKey } from '../../features/placeholders.js'; +import { updateLinkWithLangRoot } from '../../utils/helpers.js'; const ROOT_MARGIN = 50; @@ -74,9 +75,10 @@ export async function fetchBlogArticleIndex() { const pageSize = 500; const { feed } = blogIndex.config; const queryParams = `?limit=${pageSize}&offset=${blogIndex.offset}`; + const defaultPath = updateLinkWithLangRoot(`${getConfig().locale.contentRoot}/query-index.json`); const indexPath = feed ? `${feed}${queryParams}` - : `${getConfig().locale.contentRoot}/query-index.json${queryParams}`; + : `${defaultPath}${queryParams}`; if (blogIndex.complete) return (blogIndex);