mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
committed by
Bjørn Erik Pedersen
parent
27b62a546c
commit
0483299bc0
@@ -310,7 +310,7 @@ func (p *Page) createRelativeTargetPathForOutputFormat(f output.Format) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// For /index.json etc. we must use the full path.
|
// For /index.json etc. we must use the full path.
|
||||||
if strings.HasSuffix(f.BaseFilename(), "html") {
|
if f.MediaType.FullSuffix() == ".html" && filepath.Base(tp) == "index.html" {
|
||||||
tp = strings.TrimSuffix(tp, f.BaseFilename())
|
tp = strings.TrimSuffix(tp, f.BaseFilename())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -55,6 +55,8 @@ func TestPermalink(t *testing.T) {
|
|||||||
{"x/y/z/boofar.md", "http://barnew/boo/", "booslug", "", false, false, "http://barnew/boo/x/y/z/booslug/", "/boo/x/y/z/booslug/"},
|
{"x/y/z/boofar.md", "http://barnew/boo/", "booslug", "", false, false, "http://barnew/boo/x/y/z/booslug/", "/boo/x/y/z/booslug/"},
|
||||||
{"x/y/z/boofar.md", "http://barnew/boo/", "booslug", "", true, true, "http://barnew/boo/x/y/z/booslug.html", "/x/y/z/booslug.html"},
|
{"x/y/z/boofar.md", "http://barnew/boo/", "booslug", "", true, true, "http://barnew/boo/x/y/z/booslug.html", "/x/y/z/booslug.html"},
|
||||||
{"x/y/z/boofar.md", "http://barnew/boo", "booslug", "", true, true, "http://barnew/boo/x/y/z/booslug.html", "/x/y/z/booslug.html"},
|
{"x/y/z/boofar.md", "http://barnew/boo", "booslug", "", true, true, "http://barnew/boo/x/y/z/booslug.html", "/x/y/z/booslug.html"},
|
||||||
|
// Issue #4666
|
||||||
|
{"x/y/z/boo-makeindex.md", "http://barnew/boo", "", "", true, true, "http://barnew/boo/x/y/z/boo-makeindex.html", "/x/y/z/boo-makeindex.html"},
|
||||||
|
|
||||||
// test URL overrides
|
// test URL overrides
|
||||||
{"x/y/z/boofar.md", "", "", "/z/y/q/", false, false, "/z/y/q/", "/z/y/q/"},
|
{"x/y/z/boofar.md", "", "", "/z/y/q/", false, false, "/z/y/q/", "/z/y/q/"},
|
||||||
|
Reference in New Issue
Block a user