← knowledge.oriz.in

@astrojs/sitemap

service seositemapastrobuild-timeprimary

@astrojs/sitemap

Role

Generates sitemap-index.xml + sitemap-0.xml for every Astro site in the family at build time. Output ships in the static bundle on Cloudflare Pages — no runtime cost, no service to depend on.

Free tier

Card / subscription required?

NO. Pure build-time tool.

Configuration

// astro.config.mjs
import sitemap from "@astrojs/sitemap";
export default {
  site: "https://blog.oriz.in",
  integrations: [
    sitemap({
      changefreq: "weekly",
      priority: 0.7,
      lastmod: new Date(),
      filter: (page) => !page.includes("/draft/"),
    }),
  ],
};

Site URL passed to site: in the Astro config feeds the fully-qualified URLs in the output XML.

Alternatives

Swap cost

Low — output is plain sitemap.xml, the contract any consumer reads. Replacing the integration is a build-step change inside one site repo.

Why this is our pick

It's the official Astro integration. Every site already runs Astro ( context), so adding the integration is one line in astro.config.mjs. Free, OSS, no backend, no card.

Cross-refs