output: Fix permalink in sitemap etc. when multiple permalinkable output formats
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 2 May 2019 07:54:26 +0000 (09:54 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 2 May 2019 12:23:16 +0000 (14:23 +0200)
commit6b76841b052b97625b8995f326d758b89f5c2349
tree0a29c666b6e11e6c73f64da4beb0ca86d3965da5
parentbcbed4ebdaf55b67abc521d69bba456c041a7e7d
output: Fix permalink in sitemap etc. when multiple permalinkable output formats

In Hugo 0.55.0 we made AMP `permalinkable`. We also render the output formats in their natural sort order, meaning `AMP` will be rendered before `HTML`. References in the sitemap would then point to the AMP version, and this is normally not what you'd want.

This commit fixes that by making `HTML` by default sort before the others.

If this is not you want, you can set `weight` on the output format configuration.

Fixes #5910
hugolib/site_render.go
hugolib/sitemap_test.go
output/outputFormat.go
output/outputFormat_test.go