Skip to content

Latest commit

 

History

History
17 lines (8 loc) · 1.62 KB

README.md

File metadata and controls

17 lines (8 loc) · 1.62 KB

Initialize Your Hugo Project

Initializing your Hugo project with the module feature. You can do this by running hugo mod init github.com/username/reponame in your project directory.

If you wish to see the contents of your module within your project, you can make use of Hugo's hugo mod vendor command. It creates a vendor directory at the root of your project, and copies all module files into it. This is mostly used for debugging, or if you wish to make sure that all your dependencies are within your project directory. Remember to include the /vendor directory in your .gitignore file if you choose to use this, as it's not normally recommended to commit vendored dependencies to your repository.

Troubleshooting

  1. Re-Initialize Your Hugo Project: Try re-initializing your Hugo project with the module feature. You can do this by running hugo mod init github.com/username/reponame in your project directory.

  2. Check your Go version: Hugo Modules are built on top of Go Modules, which requires Go 1.11 or higher. You can check your Go version by running go version in your terminal.

  3. Manually Add Module to Go: You can try adding the module manually to Go's module list by running go get github.com/username/repo/ in your terminal. Note that this command requires the Go language to be installed on your machine.

  4. Check GOPATH and GO111MODULE: Go's environment variables could also play a part in this issue. You can try printing their values with echo $GOPATH and echo $GO111MODULE respectively. If GO111MODULE is set to off, try setting it to on or auto using export GO111MODULE=on.