Update blog sitemap

This commit is contained in:
Quinn Hegeman
2026-03-08 15:49:52 +01:00
parent f5c25dea75
commit 8f2e3bcde1
5 changed files with 36 additions and 12 deletions

10
astro/src/lib/routing.ts Normal file
View File

@@ -0,0 +1,10 @@
export function getBlogRoute(blogSettings: BlogSettings, blog: BlogPost) {
const date = new Date(blog.date);
return blogSettings.blogRouteTemplate
.replaceAll("%Y", date.getFullYear().toString())
.replaceAll("%M", (date.getMonth() + 1).toString().padStart(2, '0'))
.replaceAll("%D", date.getDate().toString().padStart(2, '0'))
.replaceAll("%R", blog.url)
.replace(/\/+/g, '/');
}