mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
Make the "is this a Hugo Module" logic more lenient
Now we only try to load modules via Go if there is one or more modules imported in project config. Fixes #6299
This commit is contained in:
@@ -250,8 +250,7 @@ func (c *collector) add(owner *moduleAdapter, moduleImport Import, disabled bool
|
||||
}
|
||||
|
||||
if moduleDir == "" {
|
||||
|
||||
if c.GoModulesFilename != "" && c.isProbablyModule(modulePath) {
|
||||
if c.GoModulesFilename != "" && isProbablyModule(modulePath) {
|
||||
// Try to "go get" it and reload the module configuration.
|
||||
if err := c.Get(modulePath); err != nil {
|
||||
return nil, err
|
||||
@@ -301,10 +300,6 @@ func (c *collector) add(owner *moduleAdapter, moduleImport Import, disabled bool
|
||||
ma.path = modulePath
|
||||
}
|
||||
|
||||
if err := ma.validateAndApplyDefaults(c.fs); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !moduleImport.IgnoreConfig {
|
||||
if err := c.applyThemeConfig(ma); err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user