Skip to content

Commit

Permalink
Workaround an issue of sitemap build when there are no categoriesx
Browse files Browse the repository at this point in the history
  • Loading branch information
igalst committed Feb 14, 2024
1 parent 2b2c30f commit eb25b01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion workspaces/cms-scripts/src/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const parsePosts = async () => {
const { filenameMap } = await getPosts();
const categories: string[] = [];

filenameMap.forEach(({ locale, category: fileCategories, slug, published_date, post_type, video }) => {
filenameMap.forEach(({ locale, category: fileCategories = [], slug, published_date, post_type, video }) => {
for (const category of fileCategories) {
if (!categories.includes(category)) {
categories.push(category);
Expand Down

0 comments on commit eb25b01

Please sign in to comment.