summaryrefslogtreecommitdiffstats
path: root/hugolib/page.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/page.go')
-rw-r--r--hugolib/page.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/hugolib/page.go b/hugolib/page.go
index e23434a78..141a71420 100644
--- 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
}