-
Notifications
You must be signed in to change notification settings - Fork 66
Closed
Description
Description
Redirect routes defined in the Zudoku config are being included in the generated sitemap. This causes redirect URLs to appear in the sitemap, which is undesirable since they don't represent actual content pages.
Steps to Reproduce
- Define a redirect in
zudoku.config.tsx:redirects: [ { from: "/dev-portal/zudoku/theme-playground", to: "https://zudoku.dev/docs/theme-playground", }, ],
- Build the site
- Check the generated
sitemap.xml
Expected Behavior
Redirect routes should be excluded from the sitemap since they don't serve actual content — they just redirect to another URL.
Actual Behavior
The redirect path (e.g., https://zuplo.com/docs/dev-portal/zudoku/theme-playground) appears in the sitemap as a regular page entry.
Root Cause
The redirectPlugin registers routes via getRoutes(), and the sitemap generator in sitemap.js iterates over all routes returned by routesToPaths() without distinguishing between content routes and redirect routes.
Suggested Fix
Filter out redirect routes when generating the sitemap, either by:
- Marking redirect routes with metadata so the sitemap generator can skip them
- Filtering paths that correspond to redirects in
generateSitemap()
Reactions are currently unavailable