mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-12 20:13:59 +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:
@@ -235,6 +235,17 @@ type Config struct {
|
||||
Private string
|
||||
}
|
||||
|
||||
// hasModuleImport reports whether the project config have one or more
|
||||
// modules imports, e.g. github.com/bep/myshortcodes.
|
||||
func (c Config) hasModuleImport() bool {
|
||||
for _, imp := range c.Imports {
|
||||
if isProbablyModule(imp.Path) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// HugoVersion holds Hugo binary version requirements for a module.
|
||||
type HugoVersion struct {
|
||||
// The minimum Hugo version that this module works with.
|
||||
|
Reference in New Issue
Block a user