aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugofs
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2021-10-17 16:11:00 +0200
committerBjørn Erik Pedersen <[email protected]>2021-10-18 12:13:13 +0200
commit096f5e19217e985bccbf6c539e1b220541ffa6f6 (patch)
treed73660bd172fe5dffd56ff7407274e4fa1d85b23 /hugofs
parentba35e69856900b6fc92681aa841cdcaefbb4b121 (diff)
downloadhugo-096f5e19217e985bccbf6c539e1b220541ffa6f6.tar.gz
hugo-096f5e19217e985bccbf6c539e1b220541ffa6f6.zip
Fix the "page picker" logic in --navigateToChanged
Fixes #9051
Diffstat (limited to 'hugofs')
-rw-r--r--hugofs/files/classifier.go10
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), ".")]
}