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
path: root/hugofs
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-10-05 14:34:14 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-11-03 15:04:37 +0300
commit85e4dd7370eae97ae367e596aa6a10ba42fd4b7c (patch)
tree23e739edbed24a62f842c1a3ebc1d9cb706ea8b7 /hugofs
parent3089fc0ba171be14670b19439bc2eab6b077b6c3 (diff)
Make js.Build fully support modules
Fixes #7816 Fixes #7777 Fixes #7916
Diffstat (limited to 'hugofs')
-rw-r--r--hugofs/fileinfo.go5
-rw-r--r--hugofs/rootmapping_fs.go1
2 files changed, 6 insertions, 0 deletions
diff --git a/hugofs/fileinfo.go b/hugofs/fileinfo.go
index 79d89a88b..5bfb1ff32 100644
--- a/hugofs/fileinfo.go
+++ b/hugofs/fileinfo.go
@@ -37,6 +37,7 @@ import (
const (
metaKeyFilename = "filename"
+ metaKeySourceRoot = "sourceRoot"
metaKeyBaseDir = "baseDir" // Abs base directory of source file.
metaKeyMountRoot = "mountRoot"
metaKeyModule = "module"
@@ -128,6 +129,10 @@ func (f FileMeta) PathFile() string {
return strings.TrimPrefix(strings.TrimPrefix(f.Filename(), base), filepathSeparator)
}
+func (f FileMeta) SourceRoot() string {
+ return f.stringV(metaKeySourceRoot)
+}
+
func (f FileMeta) MountRoot() string {
return f.stringV(metaKeyMountRoot)
}
diff --git a/hugofs/rootmapping_fs.go b/hugofs/rootmapping_fs.go
index 2c4f0df52..a38560d0a 100644
--- a/hugofs/rootmapping_fs.go
+++ b/hugofs/rootmapping_fs.go
@@ -60,6 +60,7 @@ func NewRootMappingFs(fs afero.Fs, rms ...RootMapping) (*RootMappingFs, error) {
rm.Meta = make(FileMeta)
}
+ rm.Meta[metaKeySourceRoot] = rm.To
rm.Meta[metaKeyBaseDir] = rm.ToBasedir
rm.Meta[metaKeyMountRoot] = rm.path
rm.Meta[metaKeyModule] = rm.Module