Skip to content

Commit

Permalink
fix: adjust sitemap page lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Oct 17, 2020
1 parent 0d17bcd commit 3fc584a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/store/src/serialization/sitemap.ts
Expand Up @@ -9,6 +9,7 @@ import {

export const getSiteMap = (store: Store): string => {
const config = store.config.siteMap;
const siteMapPages = typeof config === 'object' ? config.pages : undefined;
const pages: {
path?: string;
priority: number;
Expand All @@ -18,14 +19,14 @@ export const getSiteMap = (store: Store): string => {
const { path, lastModified } = getIndexPage(store) || {};
pages.push({
path,
priority: config?.pages?.home.priority || 1,
priority: siteMapPages?.home.priority || 1,
lastModified,
});
const homePages = getHomePages(store);
homePages.forEach(({ path, lastModified }: DocHomePagesPath) => {
pages.push({
path,
priority: config?.pages?.index.priority || 1,
priority: siteMapPages?.index.priority || 1,
lastModified,
});
});
Expand All @@ -34,7 +35,7 @@ export const getSiteMap = (store: Store): string => {
docPages.forEach(({ path, lastModified }: DocPagesPath) => {
pages.push({
path,
priority: config?.pages?.doc.priority || 1,
priority: siteMapPages?.doc.priority || 1,
lastModified,
});
});
Expand Down

0 comments on commit 3fc584a

Please sign in to comment.