Fix handling of content files with "." in them

As in, more dots than just to separate the extension and any language indicator.

Fixes #4559
This commit is contained in:
Bjørn Erik Pedersen
2018-04-07 10:10:06 +02:00
parent 623c9afa84
commit 2817e84240
4 changed files with 54 additions and 5 deletions

View File

@@ -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{