Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starlight with an existing sitemap integration #717

Closed
1 task
turbek opened this issue Sep 15, 2023 · 2 comments · Fixed by #796
Closed
1 task

Starlight with an existing sitemap integration #717

turbek opened this issue Sep 15, 2023 · 2 comments · Fixed by #796
Labels
enhancement Something it would be good to improve good first issue Good for newcomers

Comments

@turbek
Copy link

turbek commented Sep 15, 2023

What version of starlight are you using?

0.9.1

What version of astro are you using?

3.0.10

What package manager are you using?

npm

What operating system are you using?

Windows

What browser are you using?

Chrome

Describe the Bug

We'd like to use starlight with an existing astro setup.

Starlight forces you to use the @astrojs/sitemap integration. There is no way to opt-out (only from injecting a <link> to the head) nor configure it (add filters).

Currently there is no way to avoid this issue if you'd like to use a configured sitemap integration:

 error   Found more than one instance of @astrojs/sitemap.
  Starlight includes @astrojs/sitemap by default.
  Please remove it from your integrations array in astro.config.mjs

it is easy to check, the sitemap integration is not configurable:
https://github.com/withastro/starlight/blob/main/packages/starlight/integrations/sitemap.ts

I think it would be preferable to have an option to opt-out entirely from all of the sitemap generation in starlight in case of an existing astro setup.

Link to Minimal Reproducible Example

No response

Participation

  • I am willing to submit a pull request for this issue.
@delucis
Copy link
Member

delucis commented Sep 19, 2023

Thanks for the issue @turbek. Yes, we should probably offer a way to opt out.

We opted to make the sitemap integration built in to Starlight as it allows us to configure the i18n set up for sitemaps automatically, which otherwise would be kind of annoying to maintain twice, but an opt out for sites that need custom sitemap config probably makes sense. I guess the alternative would be allowing passing through sitemap options via Starlight? Not sure whether that’s preferable.

Would be happy to receive a PR for whichever approach someone would like to champion.

@delucis delucis added good first issue Good for newcomers enhancement Something it would be good to improve labels Sep 19, 2023
@delucis
Copy link
Member

delucis commented Sep 28, 2023

Update here: Astro 3.2 (releasing today) includes a small change that will let us make a big improvement here. We should be able to check if a user already added sitemap and if so, skip adding it in Starlight, which isn’t currently possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something it would be good to improve good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants