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

View File

@@ -1,3 +1,4 @@
import { getAllBlogs } from "@/content/blogs/blogs";
import { getSettings } from "@/content/settings/settings";
import type { APIRoute } from "astro";
import minifyXML from "minify-xml";
@@ -12,7 +13,8 @@ export const GET = (async () => {
});
}
const blogCount = 250;
const blogs = await getAllBlogs(settings);
const blogCount = blogs.length;
const perPage = settings.sitemap.perPage;
const pages = Math.ceil(blogCount / perPage);