URI: 
       hugolib: Correctly identify "my_index_page.md" - hugo - [fork] hugo port for 9front
  HTML git clone git@git.drkhsh.at/hugo.git
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
   DIR README
   DIR LICENSE
       ---
   DIR commit 17b21e0af1e716bdc7f80b0b2b19b5e469344b34
   DIR parent 7f68e3199ef3a62aef06251bd641435617257d48
  HTML Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
       Date:   Sat, 25 Mar 2017 09:56:00 +0100
       
       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:
         M hugolib/page.go                     |       9 ++++++++-
         M hugolib/site_test.go                |      14 ++++++++++++++
       
       2 files changed, 22 insertions(+), 1 deletion(-)
       ---
   DIR diff --git a/hugolib/page.go b/hugolib/page.go
       @@ -1859,8 +1859,15 @@ func sectionsFromFilename(filename string) []string {
                return sections
        }
        
       +const (
       +        regularPageFileNameDoesNotStartWith = "_index"
       +
       +        // There can be "my_regular_index_page.md but not /_index_file.md
       +        regularPageFileNameDoesNotContain = helpers.FilePathSeparator + regularPageFileNameDoesNotStartWith
       +)
       +
        func kindFromFilename(filename string) string {
       -        if !strings.Contains(filename, "_index") {
       +        if !strings.HasPrefix(filename, regularPageFileNameDoesNotStartWith) && !strings.Contains(filename, regularPageFileNameDoesNotContain) {
                        return KindPage
                }
        
   DIR diff --git 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()