Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since the refactor to use Django's i18n mechanism in #14256, not our original
Prefixer
, resolved URLs are automatically prepended withsettings.LANGUAGE_CODE
, which means theupdate_sitemaps
management command (used by www-sitemap-generator) creates a sitemap.json containing paths prefixed withen-US/
, which downstream use of this data for sitemap generation is not expecting.The simplest fix was to drop that part of the path.
Issue / Bugzilla link
Resolves #14480
Testing
Tricky to test end-to-end, or to write meaningful tests for, but I have extracted three examples of the sitemap.json file, showing that this changeset generates an identical (except for ordering of array elements) version of the data:
main
currently generates this: broken_sitemap.json (36090 lines and en-US prefixing every path)