summaryrefslogtreecommitdiffstats
path: root/hugolib/site_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-25 09:56:00 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-25 19:57:01 +0100
commit17b21e0af1e716bdc7f80b0b2b19b5e469344b34 (patch)
treee2b574deb1a1d4a5fff1a3cbd82b71b7572ca43b /hugolib/site_test.go
parent7f68e3199ef3a62aef06251bd641435617257d48 (diff)
hugolib: Correctly identify "my_index_page.md"
The above example was earlier identified as a section page and not a regular page. Fixes #3234
Diffstat (limited to 'hugolib/site_test.go')
-rw-r--r--hugolib/site_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/hugolib/site_test.go b/hugolib/site_test.go
index 7919ba377..b8a5eb211 100644
--- a/hugolib/site_test.go
+++ b/hugolib/site_test.go
@@ -201,6 +201,20 @@ func TestLastChange(t *testing.T) {
require.Equal(t, 2017, s.Info.LastChange.Year(), "Site.LastChange should be set to the page with latest Lastmod (year 2017)")
}
+// Issue #_index
+func TestPageWithUnderScoreIndexInFilename(t *testing.T) {
+ t.Parallel()
+
+ cfg, fs := newTestCfg()
+
+ writeSource(t, fs, filepath.Join("content", "sect/my_index_file.md"), "---\ntitle: doc1\nweight: 1\ndate: 2014-05-29\n---\n# doc1\n*some content*")
+
+ s := buildSingleSite(t, deps.DepsCfg{Fs: fs, Cfg: cfg}, BuildCfg{SkipRender: true})
+
+ require.Len(t, s.RegularPages, 1)
+
+}
+
// Issue #957
func TestCrossrefs(t *testing.T) {
t.Parallel()