Search documentation of phoenix_kit

# PhoenixKit.Modules.Sitemap.Web.Controller (phoenix_kit v1.7.87)

Copy Markdown View Source

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.

## Summary

### Functions

html(conn, params)

Redirects to XML sitemap (deprecated).

index_part(conn, map)

Legacy: Serves sitemap index part files.

module_sitemap(conn, map)

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

xml(conn, params)

Serves the sitemapindex XML.

xsl_index_stylesheet(conn, arg2)

Serves XSL stylesheet files for sitemapindex display.

xsl_stylesheet(conn, arg2)

Serves XSL stylesheet files for urlset display.

## Functions

# html(conn, params)

Redirects to XML sitemap (deprecated).

# index_part(conn, map)

Legacy: Serves sitemap index part files.

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

# module_sitemap(conn, map)

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(conn, params)

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(conn, arg2)

Serves XSL stylesheet files for sitemapindex display.

# xsl_stylesheet(conn, arg2)

Serves XSL stylesheet files for urlset display.

Available styles: table, minimal