Skip to content

Impossible to cleanly opt out of default sitemap filename #3456

@angelikatyborska

Description

@angelikatyborska

What version of starlight are you using?

0.36.0

What version of astro are you using?

5.14.1

What package manager are you using?

npm 11.2.0

What operating system are you using?

macos 14.7

What browser are you using?

not relevant to the bug

Describe the Bug

I need to customize the filename of the sitemap generated for my Starlight project. To do so, I am adding @astrojs/sitemap to astro.config.ts myself:

export default defineConfig({
  adapter: vercelAdapter(),
  integrations: [
    sitemap({
      filenameBase: 'sitemap-foobar',
   }),
  ]
})

However, I still want canonical links on my pages, so I do want to include site: 'https://example.com' in the config as well.

Starlight has code that detects that I have already added the sitemap plugin, so it doesn't add the plugin again and so it won't generate a second sitemap. That's good. However, it still adds a link to my page's head that links to the default sitemap-index.xml file (that doesn't exist in my project) because I set site in my config.

I would expect Starlight not to add a link to sitemap-index.xml the page's head if I am explicitly adding the sitemap plugin to the Astro config, especially if I'm using a different filename.

Link to Minimal Reproducible Example

https://idx.google.com/astro-starlight-75283240

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions