Repository navigation
fix(ui): build sitemap.xml from the pages the prerender renders - #10379
Merged
Merged
Conversation
public/sitemap.xml was kept by hand and listed 34 of the site's pages; the rest (most docs pages, the fairness report, the install pages) were reachable only by links. The prerender now writes sitemap.xml from its own crawl: every rendered page's canonical URL, deduplicated and sorted, so the sitemap lists exactly what the site serves. A page naming a canonical URL on another host fails the prerender.
Bundle ReportChanges will decrease total bundle size by 2.3kB (-0.06%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: loopover-uiAssets Changed:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10379 +/- ##
=======================================
Coverage 92.09% 92.09%
=======================================
Files 913 913
Lines 111637 111637
Branches 27310 27310
=======================================
Hits 102810 102810
Misses 7527 7527
Partials 1300 1300
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
Summary
public/sitemap.xmlwas hand-kept and listed 34 pages. Most docs pages, the fairness report and the install pages were reachable only by following links.src/lib/sitemap.tsbuilds the sitemap from rendered pages.canonicalUrlOftakes the URL each page names in<link rel="canonical">, falling back to its own loopover.ai URL.sitemapXmlwrites each URL once, sorted, so a rebuild of the same site produces identical bytes, with XML escaping. Both refuse a URL on another host.scripts/prerender-static.tsadds every rendered page's canonical URL to a set during its crawl and writesdist/client/sitemap.xml. The prerender fails if a page names a canonical URL on another host or if the sitemap is not written. It no longer reads the hand-kept file as a seed; the route files, the docs directory and the OpenAPI spec already seed every page.public/sitemap.xmlis deleted, so the list cannot drift from what is served./api/<operation>page names/apias canonical, so the sitemap lists/apirather than each operation page.ui-deploy.yml's build-output step prints the sitemap's URL count.Validation
src/lib/sitemap.test.tscovers both canonical attribute orders, the fallback, foreign-host refusal, de-duplication and sorting, the exact XML shape, and escaping.node --experimental-strip-types), with the same outputs and errors.