Skip to content

Commit

Permalink
update sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
AngeloChecked committed Oct 26, 2024
1 parent 4ccccfd commit 00bb20b
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions blog/components/SiteMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,22 @@ export function SiteMap(props: {
domain: string;
}) {
return `
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
${
props.router.map((page) => {
return siteMapUrl({
pageUrl: props.domain + page?.relativeWebsitePath ?? "/",
lastModifiedDate: props.latestBuildDate,
});
}).join("\n")
}
${props.router
.map((page) => {
return siteMapUrl({
pageUrl: props.domain + page?.relativeWebsitePath ?? "/",
lastModifiedDate: props.latestBuildDate,
});
})
.join("\n")}
</urlset>`;
}

function siteMapUrl(props: {
pageUrl: string;
lastModifiedDate: string;
}) {
function siteMapUrl(props: { pageUrl: string; lastModifiedDate: string }) {
return `<url>
<loc>${props.pageUrl}</loc>
<lastmod>${props.lastModifiedDate}</lastmod>
Expand Down

0 comments on commit 00bb20b

Please sign in to comment.