aboutsummaryrefslogtreecommitdiffhomepage
path: root/source/fileInfo.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2018-04-07 10:10:06 +0200
committerBjørn Erik Pedersen <[email protected]>2018-04-07 10:57:29 +0200
commit2817e842407c8dcbfc738297ab634392fcb41ce1 (patch)
treea5c8f9bc1b976881bd98219ebb3500ea6a85efce /source/fileInfo.go
parent623c9afa8409855ccfd7b000ae7c6780b780a5af (diff)
downloadhugo-2817e842407c8dcbfc738297ab634392fcb41ce1.tar.gz
hugo-2817e842407c8dcbfc738297ab634392fcb41ce1.zip
Fix handling of content files with "." in them
As in, more dots than just to separate the extension and any language indicator. Fixes #4559
Diffstat (limited to 'source/fileInfo.go')
-rw-r--r--source/fileInfo.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/fileInfo.go b/source/fileInfo.go
index 882ef22a7..412d64050 100644
--- a/source/fileInfo.go
+++ b/source/fileInfo.go
@@ -204,9 +204,8 @@ func (sp *SourceSpec) NewFileInfo(baseDir, filename string, isLeafBundle bool, f
// This is usyally provided by the filesystem. But this FileInfo is also
// created in a standalone context when doing "hugo new". This is
// an approximate implementation, which is "good enough" in that case.
- translationBaseName = strings.TrimSuffix(baseName, ext)
- fileLangExt := filepath.Ext(translationBaseName)
- translationBaseName = strings.TrimSuffix(translationBaseName, fileLangExt)
+ fileLangExt := filepath.Ext(baseName)
+ translationBaseName = strings.TrimSuffix(baseName, fileLangExt)
}
f := &FileInfo{