bext-plugin-sitemap

Auto-generated sitemap.xml and robots.txt from your route tree.

$ bext plugin add sitemap
Version 1.0.5
Sandbox quickjs
Author bext-team
License MIT
Downloads 4,302
Updated 2026-03-15

Generates `/sitemap.xml` and `/robots.txt` automatically from your app's route tree. Supports i18n alternate links, custom priorities, and change frequencies. Updates whenever your routes change.

Install

bext plugin add sitemap

Config

[plugins.sitemap]
hostname = "https://example.com"
exclude = ["/api/*", "/admin/*", "/_*"]
default_priority = 0.7
default_changefreq = "weekly"

Custom priorities

Override priority and changefreq per route by exporting a `sitemap` object:

export const sitemap = {
  priority: 1.0,
  changefreq: "daily",
};

i18n

If your app has locale-prefixed routes (`/en/about`, `/fr/about`), the plugin generates `hreflang` alternate links automatically.

robots.txt

The generated robots.txt allows all crawlers and points to your sitemap:

User-agent: *
Allow: /
Sitemap: https://example.com/sitemap.xml