Build map of base slugs to available languages for cross-language discovery.
O(n) implementation: two-pass approach avoids the previous O(nยฒ) nested iteration that caused timeouts when the news/ directory grew large.
Pass 1 โ baseSlug โ string[] of languages that have that article. Pass 2 โ article.slug โ the language list from pass 1.
Build map of base slugs to available languages for cross-language discovery.
O(n) implementation: two-pass approach avoids the previous O(nยฒ) nested iteration that caused timeouts when the news/ directory grew large.
Pass 1 โ baseSlug โ string[] of languages that have that article. Pass 2 โ article.slug โ the language list from pass 1.