Skip to content

refactor: move XML/RSS/sitemap routes to Trog::Routes::XML - #334

Draft
troglodyne-bot wants to merge 1 commit into
Troglodyne-Internet-Widgets:masterfrom
troglodyne-bot:koan/move-xml-rss-routes
Draft

refactor: move XML/RSS/sitemap routes to Trog::Routes::XML#334
troglodyne-bot wants to merge 1 commit into
Troglodyne-Internet-Widgets:masterfrom
troglodyne-bot:koan/move-xml-rss-routes

Conversation

@troglodyne-bot

Copy link
Copy Markdown
Contributor

What

Move sitemap, RSS, and XSL stylesheet routes out of the 1667-line Trog::Routes::HTML module into a new Trog::Routes::XML module. Also fix Trog::Routes::TXT which had the wrong package declaration (Trog::Routes::JSON) and was never wired into TCMS.pm.

Why

Closes #293 — HTML.pm was acting as a catch-all for all content types. At 1667 lines, it was overdue for decomposition. XML/RSS routes are semantically distinct from HTML page routes.

Also fixes #321 — the sitemap index was calling $data->count() which counted all posts including private/unlisted ones, potentially generating empty sitemap pages. Now counts only public posts via $data->get(limit => 0, acls => ['public']).

How

  • New Trog::Routes::XML module owns: sitemap, _rss, _post2rss, rss_style + their route entries
  • Trog::Routes::HTML::posts() calls Trog::Routes::XML::_rss() for RSS format requests
  • TCMS.pm now imports and merges %Trog::Routes::TXT::routes and %Trog::Routes::XML::routes
  • Trog::Routes::XML::sitemap() references %Trog::Routes::HTML::routes directly for static route scanning (same package, no circular dep)
  • HTML.pm shrinks from 1667 → 1390 lines

Testing

  • Existing test suite passes (only pre-existing Trog-SQLite.t dbh mock failure, tracked in Add tests for core modules #332)
  • Both new modules load cleanly under stub-dependency syntax check

🤖 Generated with Claude Code

Extracts sitemap, rss_style, _rss, and _post2rss from the 1667-line
HTML routes module into a dedicated Trog::Routes::XML module.
Also fixes Trog::Routes::TXT which had the wrong package declaration
and was never wired into TCMS.pm.

Closes Troglodyne-Internet-Widgets#293. Fixes Troglodyne-Internet-Widgets#321 (sitemap index now counts only public posts,
preventing empty sitemap pages for private/unlisted content).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure 'unlisted' type posts don't show up in the sitemap Move RSS/XML and text routes out of Trog::Routes::HTML

1 participant