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
This commit is contained in:
Bjørn Erik Pedersen
2019-05-02 09:54:26 +02:00
parent bcbed4ebda
commit 6b76841b05
4 changed files with 65 additions and 4 deletions

View File

@@ -35,7 +35,7 @@ type siteRenderContext struct {
sitesOutIdx int
// Zero based index of the output formats configured within a Site.
// Note that these outputs are sorted, so CSS will come before HTML.
// Note that these outputs are sorted.
outIdx int
multihost bool