gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
74.64k stars 7.45k forks source link

`hugo mod vendor` does not copy config directory to _vendor #9751

Closed davidsneighbour closed 2 years ago

davidsneighbour commented 2 years ago

Reading the documentation at https://gohugo.io/commands/hugo_mod_vendor/ I would assume that the process would copy over the configuration directory or file of the module too.

Currently, it appears, only directories that are explicitly mounted in the module-configuration are vendored with the addition of a package.json if it exists. The problem is, that the config directory can't be mounted and might contain information used in layouts or the module later on.

Is this by design or a bug?

jmooring commented 2 years ago

I am unable to reproduce the problem as described.

git clone --single-branch -b hugo-github-issue-9751 https://github.com/jmooring/hugo-testing hugo-github-issue-9751
cd hugo-github-issue-9751
hugo 
hugo mod vendor
tree _vendor

config.toml is present in the _vendor directory.

davidsneighbour commented 2 years ago

Please try adding the module https://github.com/dnb-org/dnb-hugo-giscus which has the configuration in a config directory. Running hugo mod vendor on a project using this module does not add the config directory. This might be related to config in the config directory only, as I don't have any module using config.toml currently...

davidsneighbour commented 2 years ago

Sample:

Before: https://github.com/davidsneighbour/kollitsch.de/tree/39772071c929233b9d373533e7c7d9bcabb0fead After hugo mod vendor: https://github.com/davidsneighbour/kollitsch.de/tree/test/vendoring

jmooring commented 2 years ago

Confirmed. A module's "config" directory is not vendored.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.