fix: Correct URL construction in generateBlogSitemapXml function

This commit is contained in:
Nawaz Dhandala
2026-01-29 08:08:40 +00:00
parent 45aab853c4
commit 0c64ba30b0

View File

@@ -496,7 +496,7 @@ export async function generateBlogSitemapXml(page: number): Promise<string> {
const entries: SitemapEntry[] = postsForPage.map((post: BlogPostHeader) => {
const loc: string = post.blogUrl.startsWith("http")
? post.blogUrl
: `${baseUrlString}${post.blogUrl.startsWith("/") ? "" : "/"}${post.blogUrl.replace(/^\//, "")}`;
: `${baseUrlString}${post.blogUrl.startsWith("/") ? post.blogUrl : `/${post.blogUrl}`}`;
return {
loc,