Skip to content

Commit 5dfa958

Browse files
heiskrCopilot
andauthored
Fix discovery landing pages dropping uncategorized articles (#60528)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 69f6394 commit 5dfa958

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/landings/components/shared/LandingArticleGridWithFilter.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ export const ArticleGrid = ({
7777
// For bespoke landing pages, show all articles regardless of includedCategories
7878
const filteredArticlesByLandingType = useMemo(() => {
7979
if (landingType === 'discovery' && includedCategories && includedCategories.length > 0) {
80-
// For discovery pages, only include articles that have at least one matching category
80+
// For discovery pages, keep articles that either have a matching category
81+
// or have no category at all (uncategorized articles are still part of the content tree).
8182
return allArticles.filter((article) => {
82-
if (!article.category || article.category.length === 0) return false
83+
if (!article.category || article.category.length === 0) return true
8384
return article.category.some((cat) =>
8485
includedCategories.some((included) => included.toLowerCase() === cat.toLowerCase()),
8586
)

0 commit comments

Comments
 (0)