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:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-02-15 13:11:34 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-02-15 13:11:34 +0300
commit3a5ee0d2d6e344b12efc7a97354ec3480c4c578b (patch)
treea20c344b14be50f1becf4e98b59bd09f4caee7bc /modules/config.go
parent4ffaeaf15536596c94dc73b393ca7894e3bd5e2c (diff)
modules: Allow absolute paths for any modules resolved via project replacement
Fixes #8240
Diffstat (limited to 'modules/config.go')
-rw-r--r--modules/config.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/config.go b/modules/config.go
index d56f38343..106becc60 100644
--- a/modules/config.go
+++ b/modules/config.go
@@ -237,6 +237,7 @@ func decodeConfig(cfg config.Provider, pathReplacements map[string]string) (Conf
for i, imp := range c.Imports {
if newImp, found := c.replacementsMap[imp.Path]; found {
imp.Path = newImp
+ imp.pathProjectReplaced = true
c.Imports[i] = imp
}
}
@@ -355,12 +356,13 @@ func (v HugoVersion) IsValid() bool {
}
type Import struct {
- Path string // Module path
- IgnoreConfig bool // Ignore any config in config.toml (will still folow imports).
- IgnoreImports bool // Do not follow any configured imports.
- NoVendor bool // Never vendor this import (only allowed in main project).
- Disable bool // Turn off this module.
- Mounts []Mount
+ Path string // Module path
+ pathProjectReplaced bool // Set when Path is replaced in project config.
+ IgnoreConfig bool // Ignore any config in config.toml (will still folow imports).
+ IgnoreImports bool // Do not follow any configured imports.
+ NoVendor bool // Never vendor this import (only allowed in main project).
+ Disable bool // Turn off this module.
+ Mounts []Mount
}
type Mount struct {