Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'hugofs/fileinfo.go')
-rw-r--r--hugofs/fileinfo.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/hugofs/fileinfo.go b/hugofs/fileinfo.go
index f5e95e952..79d89a88b 100644
--- a/hugofs/fileinfo.go
+++ b/hugofs/fileinfo.go
@@ -39,6 +39,7 @@ const (
metaKeyBaseDir = "baseDir" // Abs base directory of source file.
metaKeyMountRoot = "mountRoot"
+ metaKeyModule = "module"
metaKeyOriginalFilename = "originalFilename"
metaKeyName = "name"
metaKeyPath = "path"
@@ -100,10 +101,10 @@ func (f FileMeta) Name() string {
return f.stringV(metaKeyName)
}
-func (f FileMeta) Classifier() string {
- c := f.stringV(metaKeyClassifier)
- if c != "" {
- return c
+func (f FileMeta) Classifier() files.ContentClass {
+ c, found := f[metaKeyClassifier]
+ if found {
+ return c.(files.ContentClass)
}
return files.ContentClassFile // For sorting
@@ -131,6 +132,10 @@ func (f FileMeta) MountRoot() string {
return f.stringV(metaKeyMountRoot)
}
+func (f FileMeta) Module() string {
+ return f.stringV(metaKeyModule)
+}
+
func (f FileMeta) Weight() int {
return f.GetInt(metaKeyWeight)
}