mirror of
https://github.com/vercel/commerce.git
synced 2025-05-09 19:27:53 +00:00
fixed sitemap
This commit is contained in:
parent
83856a4941
commit
40e8b79c44
@ -36,17 +36,18 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
|
|
||||||
const pagesPromise = getPages().then((pages) =>
|
const pages = getPages().map((page) => ({
|
||||||
pages.map((page) => ({
|
|
||||||
url: `${baseUrl}/${page.handle}`,
|
url: `${baseUrl}/${page.handle}`,
|
||||||
lastModified: page.updatedAt
|
lastModified: page.updatedAt
|
||||||
}))
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
let fetchedRoutes: Route[] = [];
|
let fetchedRoutes: Route[] = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fetchedRoutes = (await Promise.all([collectionsPromise, productsPromise, pagesPromise])).flat();
|
fetchedRoutes = [
|
||||||
|
...(await Promise.all([collectionsPromise, productsPromise])).flat(),
|
||||||
|
...pages
|
||||||
|
];
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw JSON.stringify(error, null, 2);
|
throw JSON.stringify(error, null, 2);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user