Closed dvarrazzo closed 4 years ago
Thank you for your contribution. Is there a reason why stability matters for the sitemap? I did some quick googling but didn't find anything about it.
If it does matter I think we should add some text why we sort the children.
My use case is when reviewing the history of changes: if the rendered pages are committed in git, the sitemap changes almost every time.
Even more useful is to use git diff
on the build to verify that some changes in the code or in the templates of the website doesn't result in unwanted changes in the built pages: again a random sitemap adds a lot of noise.
I see, that makes sense!
Would you mind adding a sentence or two explaining why |sort(attribute='path')
is used in the example? I think something like "The sort filter is necessary to ensure that the elements are always in the same order on every render. This is useful if you version control the output (e.g. if you use GitHub pages with history enabled). Otherwise, every commit may contain randomly moved lines in the sitemap." should do it.
Sure, no problem. I would have left just a comment at the bottom of the page, but I'm not so keen on Disqus so I thought to open a MR.
Thank you!
The sitemap created following the guide at https://www.getlektor.com/docs/guides/sitemap/ is unstable and may change every time the page is re-generated, see
https://githistory.xyz/psycopg/psycopg.github.io/blob/master/sitemap.xml https://githistory.xyz/dvarrazzo/dvarrazzo.github.io/blob/master/sitemap.xml
sorting children should make it stable.