mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
hugolib: Correctly identify "my_index_page.md"
The above example was earlier identified as a section page and not a regular page. Fixes #3234
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user