diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2021-10-17 16:11:00 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2021-10-18 12:13:13 +0200 |
commit | 096f5e19217e985bccbf6c539e1b220541ffa6f6 (patch) | |
tree | d73660bd172fe5dffd56ff7407274e4fa1d85b23 /hugofs/files | |
parent | ba35e69856900b6fc92681aa841cdcaefbb4b121 (diff) |
Fix the "page picker" logic in --navigateToChanged
Fixes #9051
Diffstat (limited to 'hugofs/files')
-rw-r--r-- | hugofs/files/classifier.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/hugofs/files/classifier.go b/hugofs/files/classifier.go index f0e0911ab..aab199850 100644 --- a/hugofs/files/classifier.go +++ b/hugofs/files/classifier.go @@ -69,6 +69,16 @@ func IsContentFile(filename string) bool { return contentFileExtensionsSet[strings.TrimPrefix(filepath.Ext(filename), ".")] } +func IsIndexContentFile(filename string) bool { + if !IsContentFile(filename) { + return false + } + + base := filepath.Base(filename) + + return strings.HasPrefix(base, "index.") || strings.HasPrefix(base, "_index.") +} + func IsHTMLFile(filename string) bool { return htmlFileExtensionsSet[strings.TrimPrefix(filepath.Ext(filename), ".")] } |