Skip to content

Add trailing slash to auto generated sitemap.xml #4134

Description

@kkhoury38

💥 Add a trailing slash to the urls generated in sitemap.xml

Urls in sitemap.xml are currently listed without a trailing slash (i.e. ./blog instead of ./blog/), while, when going to the page, it redirects to the url with a trailing slash (i.e ./blog redirects to ./blog/)

This results in google indexing the page with a "redirect error".

A temporary fix for user created content pages is to add a trailing slash on the "slag" property value. This will not work though on all pages that are automatically generated by docusaurus. Pages include:

/blog
/blog/tags
/blog/tags/TAG_NAME

The proposal is to add a trailing slash to those urls when generating sitemap.xml

Current version:

@docusaurus/core: 2.0.0-alpha.69,
@docusaurus/preset-classic: 2.0.0-alpha.69,

Example sitemap

https://atman-iot.com/sitemap.xml

Issue example

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalThis issue is a proposal, usually non-trivial change

    Type

    No type

    Fields

    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