rm.Meta.BaseDir = rm.ToBasedir
rm.Meta.MountRoot = rm.path
rm.Meta.Module = rm.Module
+ rm.Meta.IsProject = rm.IsProject
meta := rm.Meta.Copy()
To string // The source directory or file.
ToBasedir string // The base of To. May be empty if an absolute path was provided.
Module string // The module path/ID.
+ IsProject bool // Whether this is a mount in the main project.
Meta *FileMeta // File metadata (lang etc.)
fi FileMetaInfo
isAbs := filepath.IsAbs(filename)
for _, dir := range b.SourceFilesystems.Content.Dirs {
meta := dir.Meta()
- if meta.Module != "project" {
+ if !meta.IsProject {
continue
}
if isAbs {
contentDirs := b.SourceFilesystems.Content.Dirs
for i := len(contentDirs) - 1; i >= 0; i-- {
meta := contentDirs[i].Meta()
- if meta.Module == "project" {
+ if meta.IsProject {
return filename, filepath.Join(meta.Filename, filename), nil
}
}
To: filename,
ToBasedir: base,
Module: md.Module.Path(),
+ IsProject: md.isMainProject,
Meta: &hugofs.FileMeta{
Watch: md.Watch(),
Weight: mountWeight,