Repository navigation
CLI: --sitemap reads routes from the right side's sitemap - #67
Merged
Merged
Conversation
Reads <right>/sitemap.xml (or --sitemap=<url-or-path>), follows one sitemap-index level, reads every <loc> as a path on right whatever its host, and drops file URLs. Routes given explicitly come first and the sitemap doesn't repeat their paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… under exit 2 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tmashara
force-pushed
the
claude/issue-46-sitemap
branch
from
October 29, 2026 16:52
cf44be0 to
9297c04
Compare
This was referenced Oct 29, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
--sitemap[=<url-or-path>]adds the paths in the right side's sitemap to the routes. Bare--sitemapreads<right>/sitemap.xml.--sitemap=/sitemap-index.xmlor a full URL picks another one. PrintsSitemap: <url>: N routes[, M files dropped]beforeRoutes: N.--dry-runfetches the sitemap and lists the pairs.Why
Listing every route by hand is the slowest part of setting up a run, and most sites already publish the list.
Design decisions
<loc>, for pages and for child sitemaps, is reduced topathname + searchand loaded on right. A local base build's sitemap names the production host (Astrosite, next-sitemap, HugobaseURL), so dropping other hosts would drop everything. The sitemap protocol already requires every URL to share one host. A deliberately cross-host sitemap would load foreign paths on right; those 404 or error visibly, and--dry-runshows them..pdf,.xml, images, media, office docs, ...) are skipped. It's a denylist, so.php,.aspxand/v1.2stay./awith its ownbeforehook plus a plain sitemap/awould otherwise throw "two routes both read as /a". It also keeps/pricing::/plansfrom being repeated as a plain/plans.<urlset>/<sitemapindex>(for example an SPA fallback answering 200 with index.html), a sitemap with no page paths, or--sitemap=with no value.renderdiff --sitemap http://l http://rkeeps both origins. A value needs=.<loc>(CDATA and the five XML entities handled) plus globalfetch.Cut from the issue
--include/--excludeglobs: no other route filter exists in the CLI, and a child sitemap (--sitemap=/sitemap-blog.xml) or explicit routes already narrow the set. These can follow if wanted..xml.gzserved withoutContent-Encoding: the common generators don't emit it by default, andfetchalready handlesContent-Encoding: gzip. This can follow if wanted.How tested
New
tests/unit/sitemap.test.ts, which goes through--dry-runagainst a localnode:httpserver standing in for right (no browser). It covers:--sitemap=<path>beforehook against the same sitemap path--sitemapbefore the positional originscli-args.test.tsnow checks that--helpmentions--sitemap.Run against main's
src/cli.ts, those tests fail (9 failures). Without the covered-path filter, the two explicit-route tests fail.npm run typecheck,lint,format:check,npm test(302) andnpm run test:visual(330) all pass.Docs: README (non-goals line, flag table, routes paragraph, exit-2 row), the
--helpexit sentence, and the skill's SKILL.md / reference.md route guidance.Fixes #46
🤖 Generated with Claude Code