summaryrefslogtreecommitdiffstats
path: root/hugolib/page_paths.go
diff options
context:
space:
mode:
authorCameron Moore <moorereason@gmail.com>2018-12-21 02:42:37 -0600
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-12-21 09:42:37 +0100
commit0483299bc06a742d40528e0d675e42e149910853 (patch)
treea6ac869dabe6922216a8d843b2bb931ef31c36c9 /hugolib/page_paths.go
parent27b62a546cd5c49df7424caeabe4af35ddd3bd90 (diff)
hugolib: Improve logic of output path trimming
Fixes #4666
Diffstat (limited to 'hugolib/page_paths.go')
-rw-r--r--hugolib/page_paths.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/hugolib/page_paths.go b/hugolib/page_paths.go
index 756a0f2f2..a24789bf9 100644
--- a/hugolib/page_paths.go
+++ b/hugolib/page_paths.go
@@ -310,7 +310,7 @@ func (p *Page) createRelativeTargetPathForOutputFormat(f output.Format) string {
}
// 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())
}