hugolib: Fix alias path for AMP and similar

Fixes #5760
This commit is contained in:
Bjørn Erik Pedersen 2019-03-30 16:46:18 +01:00
parent 439ab0339d
commit f9d6feca08
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
2 changed files with 2 additions and 2 deletions

View file

@ -80,7 +80,7 @@ func TestAliasMultipleOutputFormats(t *testing.T) {
// the alias redirectors // the alias redirectors
b.AssertFileContent("public/foo/bar/index.html", "<meta http-equiv=\"refresh\" content=\"0; ") b.AssertFileContent("public/foo/bar/index.html", "<meta http-equiv=\"refresh\" content=\"0; ")
b.AssertFileContent("public/foo/bar/amp/index.html", "<meta http-equiv=\"refresh\" content=\"0; ") b.AssertFileContent("public/amp/foo/bar/index.html", "<meta http-equiv=\"refresh\" content=\"0; ")
assert.False(b.CheckExists("public/foo/bar/index.json")) assert.False(b.CheckExists("public/foo/bar/index.json"))
} }

View file

@ -305,7 +305,7 @@ func (s *Site) renderAliases() error {
for _, a := range p.Aliases() { for _, a := range p.Aliases() {
if f.Path != "" { if f.Path != "" {
// Make sure AMP and similar doesn't clash with regular aliases. // Make sure AMP and similar doesn't clash with regular aliases.
a = path.Join(a, f.Path) a = path.Join(f.Path, a)
} }
lang := p.Language().Lang lang := p.Language().Lang