Skip to content

Commit

Permalink
fix(bodiless-next): Fixing EmptySitemap error in @sites/--minimal-nex…
Browse files Browse the repository at this point in the history
…t-- build (#2079)
  • Loading branch information
dewen committed May 13, 2023
1 parent c9e70bd commit 9e95283
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ node_modules

# Temporary files
.DS_Store
.swp
*.swp
*.swo
.eslintcache
*.tsbuildinfo
# jetbrains files:
Expand Down
3 changes: 2 additions & 1 deletion packages/bodiless-next/src/Webpack/Sitemapxml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const generateSitemapXml = async (options: Partial<SitemapxmlConfig> | undefined
if (!siteUrl) return;

const pages = await getPages();
if (!pages.length) return;

const mergedOptions = {
...bodilessNextConfigPath.sitemapxml,
Expand All @@ -68,7 +69,7 @@ const generateSitemapXml = async (options: Partial<SitemapxmlConfig> | undefined
)
)) : pages;

const serializedPages = filteredPages.filter(Boolean).map((page: string) => serialize(
const serializedPages = filteredPages.map((page: string) => serialize(
new URL(page, siteUrl).pathname
));

Expand Down

0 comments on commit 9e95283

Please sign in to comment.