Skip to content

Commit

Permalink
fix: full path for sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Oct 17, 2020
1 parent c81f58f commit 673e6fc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/store/src/serialization/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Store } from '@component-controls/core';
import { Store, removeTrailingSlash } from '@component-controls/core';
import {
getIndexPage,
getHomePages,
Expand All @@ -9,6 +9,8 @@ import {

export const getSiteMap = (store: Store): string => {
const config = store.config.siteMap;
const { siteUrl = '' } = store.config;
const sitePath = removeTrailingSlash(siteUrl);
const siteMapPages = typeof config === 'object' ? config.pages : undefined;
const pages: {
path?: string;
Expand Down Expand Up @@ -45,7 +47,7 @@ export const getSiteMap = (store: Store): string => {
${pages
.map(
({ path, priority, lastModified }) =>
`<url><loc>${path}</loc>${
`<url><loc>${sitePath}${path}</loc>${
lastModified ? `<lastmod>${lastModified}</lastmod>` : ''
}<changefreq>daily</changefreq><priority>${priority}</priority></url>`,
)
Expand Down

0 comments on commit 673e6fc

Please sign in to comment.