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.
Just wanted to open a draft PR here with this naive implementation, which takes all the HTML files and generates the sitemap with all of them.
However, I realized that this way we'll end up with all the old versions also in the sitemap, and I don't this that's a good idea, since sitemaps should also point to canonical content. So we need to be a bit smarter about it.
We could try to interpret the file system paths, but I figured a better way is to re-use canonical URLs, which we can parse from the HTML. The sitemap will be just the canonical URLs, but we'll also make sure that the canonical URL is reasonable. HTML files with missing or broken canonical URLs get ignored.
This pushes the responsibility of having good canonical URLs to the HTML generation. So I think we want a post-processing step here as well for each subpage, to catch and/or fix bad or missing canonical URLs.