Skip to content

Commit

Permalink
Add services to sitemap.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmurray8 committed Jun 16, 2024
1 parent 9b4a9fc commit ccba2d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/api/__sitemap__/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function parseImageOrVideo(file: {
export default defineSitemapEventHandler(async (e) => {
const contentList = (await serverQueryContent(e).find()) as ParsedContent[];
return contentList
.filter((c) => c._dir === 'product' || c._dir === 'home')
.filter((c) => c._dir === 'product' || c._dir === 'home' || c._dir === 'service')
.map((c) => {
if (c._dir === 'product') {
const sitemapUrl: SitemapUrl = {
Expand Down Expand Up @@ -110,6 +110,12 @@ export default defineSitemapEventHandler(async (e) => {
],
};
return asSitemapUrl(sitemapUrl);
} else if (c._dir === 'service') {
const sitemapUrl: SitemapUrl = {
loc: `/${c._dir}s/${c.path}`,
};
return asSitemapUrl(sitemapUrl);

}
});
});
Expand Down

0 comments on commit ccba2d3

Please sign in to comment.