aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugofs/files/classifier.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugofs/files/classifier.go')
-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), ".")]
}