# Generating Sitemaps

> Generates a sitemap.xml for a static site from its built HTML — collects page URLs, assigns priorities, and escapes entities per the bundled rules. Use after a build when the sitemap is missing or stale.

- Skill: `brokenrobot-xyz/generating-sitemaps` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add brokenrobot-xyz/generating-sitemaps`
- Raw SKILL.md: https://api.skillmd.com/api/skills/brokenrobot-xyz/generating-sitemaps/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: brokenrobot-xyz (https://skillmd.com/u/brokenrobot-xyz)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/brokenrobot-xyz/generating-sitemaps

---


# Generate a sitemap

Build `sitemap.xml` from the built site's HTML files, following the three rule files:
[`references/url-rules.md`](references/url-rules.md),
[`references/priorities.md`](references/priorities.md), and
[`references/escaping.md`](references/escaping.md).

## Steps

1. Collect every `.html` file under the build directory with `Glob`.
2. Map each file to its canonical URL per the URL rules.
3. Assign each URL a priority per the priority table.
4. Escape each URL per the escaping rules. Never emit an unescaped ampersand.
5. Write `sitemap.xml` at the build root and report the URL count.

