summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--target/page.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/target/page.go b/target/page.go
index fb081fedb..57e3a300b 100644
--- a/target/page.go
+++ b/target/page.go
@@ -40,13 +40,14 @@ func (pp *PagePub) Translate(src string) (dest string, err error) {
}
dir, file := filepath.Split(src)
+ isRoot := dir == ""
ext := pp.extension(filepath.Ext(file))
name := filename(file)
if pp.PublishDir != "" {
dir = filepath.Join(pp.PublishDir, dir)
}
- if pp.UglyURLs || file == "index.html" || file == "404.html" {
+ if pp.UglyURLs || file == "index.html" || (isRoot && file == "404.html") {
return filepath.Join(dir, fmt.Sprintf("%s%s", name, ext)), nil
}