Open kmpm opened 2 weeks ago
I'm seeing this error too on MacOS.
Ananke v1 had no module setup. v2 has since v2.11.1. You need to use
hugo mod get github.com/theNewDynamic/gohugo-theme-ananke/v2
See https://github.com/theNewDynamic/gohugo-theme-ananke/releases/tag/v2.11.1 for some details. The docs need updating.
Other than that, this is a limitation in the way Go does versioning. v0 and v1 require only the path, from v2 on the path needs a version string with the major version at the end.
You could also use a commit hash like this: github.com/theNewDynamic/gohugo-theme-ananke@1234567
but this will probably be overridden next time you call to hugo mod get -u ./...
.
@davidsneighbour go works in mysterious ways sometimes but how would that explain that I do get the exact same error when trying v2 as described in the release descriptions
$ hugo mod get github.com/theNewDynamic/gohugo-theme-ananke/v2
go: no module dependencies to download
go: github.com/theNewDynamic/gohugo-theme-ananke@upgrade: no matching versions for query "upgrade"
hugo: collected modules in 903 ms
Error: failed to load modules: failed to get ["github.com/theNewDynamic/gohugo-theme-ananke@upgrade"]: failed to execute 'go [get github.com/theNewDynamic/gohugo-theme-ananke@upgrade]': failed to execute binary "go" with args [get github.com/theNewDynamic/gohugo-theme-ananke@upgrade]: go: github.com/theNewDynamic/gohugo-theme-ananke@upgrade: no matching versions for query "upgrade"
*errors.errorString
edit: same with commit hash
$ hugo mod get github.com/theNewDynamic/gohugo-theme-ananke@892eaf2
go: no module dependencies to download
go: github.com/theNewDynamic/gohugo-theme-ananke@upgrade: no matching versions for query "upgrade"
hugo: collected modules in 848 ms
Error: failed to load modules: failed to get ["github.com/theNewDynamic/gohugo-theme-ananke@upgrade"]: failed to execute 'go [get github.com/theNewDynamic/gohugo-theme-ananke@upgrade]': failed to execute binary "go" with args [get github.com/theNewDynamic/gohugo-theme-ananke@upgrade]: go: github.com/theNewDynamic/gohugo-theme-ananke@upgrade: no matching versions for query "upgrade"
*errors.errorString
Oh... the theme setting in hugo.toml must be changed as well.
theme = ["github.com/theNewDynamic/gohugo-theme-ananke/v2"]
otherwise it doesn't matter what arguments I give to hugo mod get
yes. I also think that hugo mod get
is not required to install the module, because Hugo will load the module based on the config the next time you start it. hugo mod get
is helpful if you want to force a specific version or hash.
When following the instructions for how to install this theme using the module method I get an error about not being able to get the module.
Note: I cannot run
hugo config --format toml
to get the config because this generates the same error so I just pasted the config instead.Expected Behavior
Current Behavior
Just for good measure I tried
hugo mod get
as well.Possible Solution
Steps to Reproduce
hugo new site quickstart
cd quickstart
go mod init quickstart
echo 'theme = ["github.com/theNewDynamic/gohugo-theme-ananke"]' >> hugo.toml
hugo server -D
The bigger picture (we need context)
Running this on a Raspberry Pi 5 with latest RaspiOS updated todady (debian 12.
Hugo Config
baseURL = 'https://example.org/' languageCode = 'en-us' title = 'My New Hugo Site' theme = ["github.com/theNewDynamic/gohugo-theme-ananke"]