# `PhoenixKit.Modules.Sitemap.Web.Controller`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.87/lib/modules/sitemap/web/controller.ex#L1)

Controller for serving XML sitemaps with XSL styling.

## Endpoints

- GET /{prefix}/sitemap.xml - sitemapindex (always)
- GET /{prefix}/sitemap.xml?format=html - Server-rendered HTML (for iframe previews)
- GET /{prefix}/sitemap.html - Redirects to sitemap.xml (deprecated)
- GET /{prefix}/sitemaps/:filename - Per-module sitemap files
- GET /{prefix}/assets/sitemap/:style - XSL stylesheets for urlset files
- GET /{prefix}/assets/sitemap-index/:style - XSL stylesheets for sitemapindex

## Architecture

`/sitemap.xml` always returns a `<sitemapindex>` referencing per-module
sitemap files at `/sitemaps/sitemap-{source}.xml`. Each module file
contains a `<urlset>` with URLs from that source.

# `html`

Redirects to XML sitemap (deprecated).

# `index_part`

Legacy: Serves sitemap index part files.

Kept for backward compatibility. New architecture uses /sitemaps/:filename.

# `module_sitemap`

Serves per-module sitemap files from /sitemaps/:filename.

Filename is validated to contain only `[a-z0-9-]` characters.
The `.xml` extension is appended automatically.

# `xml`

Serves the sitemapindex XML.

Always returns a `<sitemapindex>`. Generate on first request if missing.
Query parameters:
- `style` - Override XSL style (table, minimal)
- `format=html` - Force server-side HTML rendering (for iframe previews)

# `xsl_index_stylesheet`

Serves XSL stylesheet files for sitemapindex display.

# `xsl_stylesheet`

Serves XSL stylesheet files for urlset display.

Available styles: table, minimal

---

*Consult [api-reference.md](api-reference.md) for complete listing*
