aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2020-09-09 19:08:03 +0200
committerBjørn Erik Pedersen <[email protected]>2020-09-10 08:47:05 +0200
commit20af9a078189ce1e92a1d2047c90fba2a4e91827 (patch)
tree2249411bcbdf6318dc96a12fde816178bed364e2 /modules
parent9a1e6d15a31ec667b2ff9cf20e43b1daca61e004 (diff)
downloadhugo-20af9a078189ce1e92a1d2047c90fba2a4e91827.tar.gz
hugo-20af9a078189ce1e92a1d2047c90fba2a4e91827.zip
modules: Add ignoreImports to module imports config
Fixes #7646
Diffstat (limited to 'modules')
-rw-r--r--modules/client.go2
-rw-r--r--modules/collect.go2
-rw-r--r--modules/config.go10
3 files changed, 8 insertions, 6 deletions
diff --git a/modules/client.go b/modules/client.go
index 914d06a4e..86f8a2caa 100644
--- a/modules/client.go
+++ b/modules/client.go
@@ -219,7 +219,7 @@ func (c *Client) Vendor() error {
// This is the project.
continue
}
- // We respect the --ignoreVendor flag even for the vendor command.
+
if !t.IsGoMod() && !t.Vendor() {
// We currently do not vendor components living in the
// theme directory, see https://github.com/gohugoio/hugo/issues/5993
diff --git a/modules/collect.go b/modules/collect.go
index f87ed2484..b82d395fd 100644
--- a/modules/collect.go
+++ b/modules/collect.go
@@ -339,7 +339,7 @@ func (c *collector) addAndRecurse(owner *moduleAdapter, disabled bool) error {
if err != nil {
return err
}
- if tc == nil {
+ if tc == nil || moduleImport.IgnoreImports {
continue
}
if err := c.addAndRecurse(tc, disabled); err != nil {
diff --git a/modules/config.go b/modules/config.go
index a50845df3..5e95f0ac1 100644
--- a/modules/config.go
+++ b/modules/config.go
@@ -301,10 +301,12 @@ func (v HugoVersion) IsValid() bool {
}
type Import struct {
- Path string // Module path
- IgnoreConfig bool // Ignore any config.toml found.
- Disable bool // Turn off this module.
- Mounts []Mount
+ 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
}
type Mount struct {