Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/index/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,19 @@ async function addSimpleSitemapIndex(context, info, config) {
export async function fetchExtendedIndex(context, info) {
const { log } = context;

let config = await context.fetchIndex(info);
const config = await context.fetchIndex(info);
const errors = config?.getErrors();
if (errors?.length) {
const detail = errors.map(({ message }) => (message)).join('\n');
log.warn(`Unable to add simple sitemap, index configuration contains errors:
${detail}`);
} else {
config = await addSimpleSitemapIndex(context, info, config);
return null;
}
const sitemap = await context.fetchSitemap(info);
if (sitemap) {
return config;
}
return config;
return addSimpleSitemapIndex(context, info, config);
}

/**
Expand Down