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

Missing slash in sitemap URL scheme when upgrading from sphinx-sitemap 2.2 to 2.3 #60

Open
andersfagerli opened this issue Feb 23, 2023 · 2 comments

Comments

@andersfagerli
Copy link

andersfagerli commented Feb 23, 2023

Hi!

I was on Sphinx<5 and sphinx-sitemap==2.2 and updated my project dependencies to Sphinx>5 and sphinx-sitemap>2.2. When I did so, I noticed that the URLs generated in sitemap.xml where missing a backslash before {lang}, which made the URLs incorrect. See the picture below for the diff:
bilde

I can solve this by setting sitemap_url_scheme = "/{lang}{version}{link}", but that doesn't look like a good solution to me. Do you know if there is any other source of error here, possibly within sphinx-sitemap? I've seen https://sphinx-sitemap.readthedocs.io/en/latest/advanced-configuration.html, but this error appears when just changing between sphinx-sitemap 2.2 to 2.3 (and keeping Sphinx>5 constant), so it looks like it was introduced by upgrading sphinx-sitemap.

@jdillard
Copy link
Owner

jdillard commented Feb 27, 2023

It looks like you have Sphinx<5 on the left since you have {html_baseurl}/404.html on the left and {html_baseurl}en/404.html on the right. I don't see any code changes between 2.2 and 2.5 that look like they would change the behavior.

The {html_basurl} gets a forward slash automatically added here, so I'm guessing something might be happening with using the plus operator? (I need to convert to using format)

I don't have an immediate answer as to what is going on, I'll have to test some more.

@andersfagerli
Copy link
Author

Thanks! I'll keep sitemap_url_scheme = "/{lang}{version}{link} for now, although I suspect this might break down the line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants