Skip to content

fix: sitemap URLs not XML-encoded and no sitemap index for large sites #137

@rohilsurana

Description

@rohilsurana

Problem

`src/server/routes/sitemap.xml.ts` has two issues:

  1. URLs not encoded — slugs with special characters (`&`, `<`, spaces) break XML validity:
    ```xml
    https://docs.example.com/guides/Q&A
    ```

  2. No sitemap index — generates a single monolithic sitemap. Google's limit is 50MB / 50,000 URLs. Large doc sites with many API endpoints could exceed this.

Suggested Fix

  • XML-encode all URL values in the sitemap
  • For sites exceeding 10k URLs, generate a sitemap index pointing to paginated sitemaps

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions