Fix hugo mod vendor for modules with hugo.toml

Fixes #11221
This commit is contained in:
Bjørn Erik Pedersen 2023-07-08 12:25:53 +02:00
parent 6019953769
commit 0f921ace6f
3 changed files with 28 additions and 1 deletions

View file

@ -292,8 +292,10 @@ func (c *Client) Vendor() error {
}
}
// Also include any theme.toml or config.* files in the root.
// Also include any theme.toml or config.* or hugo.* files in the root.
configFiles, _ := afero.Glob(c.fs, filepath.Join(dir, "config.*"))
configFiles2, _ := afero.Glob(c.fs, filepath.Join(dir, "hugo.*"))
configFiles = append(configFiles, configFiles2...)
configFiles = append(configFiles, filepath.Join(dir, "theme.toml"))
for _, configFile := range configFiles {
if err := hugio.CopyFile(c.fs, configFile, filepath.Join(vendorDir, t.Path(), filepath.Base(configFile))); err != nil {