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

🐛 BUG: Sitemap generation does not contain base path #3546

Closed
1 task done
caioferrarezi opened this issue Jun 7, 2022 · 1 comment · Fixed by #3553
Closed
1 task done

🐛 BUG: Sitemap generation does not contain base path #3546

caioferrarezi opened this issue Jun 7, 2022 · 1 comment · Fixed by #3553
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@caioferrarezi
Copy link
Contributor

What version of astro are you using?

1.0.0-beta.41

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

yarn

What operating system are you using?

Linux

Describe the Bug

I'm using the v0.1.0 of @astrojs/sitemap and it's not generating the urls with the base path configured.

In my project I have something like:

export default defineConfig({
  site: 'https://www.example.com.br',
  base: '/c',
  ...
})

The final sitemap URLs come without the /c, so https://www.example.com.br/c/my-path is https://www.example.com.br/my-path.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-dhjv1h

Participation

  • I am willing to submit a pull request for this issue.
@caioferrarezi
Copy link
Contributor Author

I forgot to say that the canonicalURL config option has the same problem as well. Apparently, adding something like https://www.example.com/c as the URL constructor base param trims the base path. https://github.com/withastro/astro/blob/main/packages/integrations/sitemap/src/index.ts#L71

@natemoo-re natemoo-re added - P4: important Violate documented behavior or significantly impacts performance (priority) s1-small labels Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants