ref: f9d6feca0802cd83c4d843244ce389cf7c792cec
parent: 439ab0339d9ac6972caabaa55fa41887ace839cb
author: Bjørn Erik Pedersen <[email protected]>
date: Sat Mar 30 12:46:18 EDT 2019
hugolib: Fix alias path for AMP and similar Fixes #5760
--- a/hugolib/alias_test.go
+++ b/hugolib/alias_test.go
@@ -80,7 +80,7 @@
// the alias redirectors
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"))
}
--- a/hugolib/site_render.go
+++ b/hugolib/site_render.go
@@ -305,7 +305,7 @@
for _, a := range p.Aliases() {
if f.Path != "" {
// 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