Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-04-07 11:10:06 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-04-07 11:57:29 +0300
commit2817e842407c8dcbfc738297ab634392fcb41ce1 (patch)
treea5c8f9bc1b976881bd98219ebb3500ea6a85efce /source/fileInfo_test.go
parent623c9afa8409855ccfd7b000ae7c6780b780a5af (diff)
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_test.go')
-rw-r--r--source/fileInfo_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/fileInfo_test.go b/source/fileInfo_test.go
index 770478e60..ec2a17c65 100644
--- a/source/fileInfo_test.go
+++ b/source/fileInfo_test.go
@@ -49,6 +49,13 @@ func TestFileInfo(t *testing.T) {
assert.Equal("b", f.Section())
}},
+ {filepath.FromSlash("/a/"), filepath.FromSlash("/a/b/page.en.MD"), func(f *FileInfo) {
+ assert.Equal("b", f.Section())
+ assert.Equal(filepath.FromSlash("b/page.en.MD"), f.Path())
+ assert.Equal(filepath.FromSlash("page"), f.TranslationBaseName())
+ assert.Equal(filepath.FromSlash("page.en"), f.BaseFileName())
+
+ }},
} {
f := s.NewFileInfo(this.base, this.filename, false, nil)
this.assert(f)