I am experiencing a new kind of failure with creating pages using hugo new …. Using history, I verified that I am using the same commands as always. I don’t understand what has changed or what I’m newly doing wrong.
At the root of the site, one level above content, I try to run any of the following commands
hugo new test.md
hugo new notes/test.md
hugo new -k notes test.md
hugo new -k notes notes/test.md
I ran into this as well. I think it might be a bug in the latest code.
I installed hugo with homebrew and I was using the exact version you were using.
The hugo new command worked when I downloaded the actual theme into the themes/ dir, but it was not working when I attempted to use hugo modules.
I ended up downloading 0.88.1 from the release page (Release v0.88.1 · gohugoio/hugo · GitHub), unzipping that, and then moving the hugo binary to /usr/local/bin/.
That fixed the issue for me. Hopefully that helps until there is a fix for this.
The error you report has been discussed sometime ago over here
Don’t have the time to debug this for you, but if you keep having problems perhaps you would need to share a sample repo with dummy content that replicates your setup, including the Archetypes directory for people in this forum to see what may be wrong.
How are you including the theme that has the archetype, or is it a site-specific archetype? Like onedrawingperday said we need the full repo, or a test case that has the same issue. See Requesting Help.
In particular, if using modules, is the archetypes dir being mounted on the virtual filesystem?
hugo new site test
cd test
hugo mod init test
#add this to config.toml:
[module]
[[module.imports]]
path = "github.com/spf13/hyde"
hugo mod get ./...
When I ran the command hugo mod vendor and added the theme to the _vendor directory (which it generated), v0.89.2+extended darwin/amd64 BuildDate=unknown was able to run hugo new content/test.md. I couldn’t really find much info on the virtual filesystem mentioned above, but I’m glad I at least figured out how to make it work with the new version of hugo (0.89).
My issue appears to be the same as that documented at
89.3 changed the error message from Error: open : no such file or directory
to Error: could not determine content directory for …
Not seeking further de-bugging assistance on this, with a couple work-arounds having been suggested, including downgrading to 88.x. Just flagging that a new failure appeared in 89.x across my different computers and Hugo sites, without my having changed their configuration. That suggests to me that something broke in 89.0 with the archetypes changes referenced above, or (if you don’t want to call it “broken”), there was a behavior change that’s not yet very clearly documented.
I am having a similar issue in which: if I enter hugo new foo I receive the error failed to resolve "foo" to a archetype template. I have appropriate archive templates for my site and I never received this error before upgrading to 89.x. 89.4 has not solved the issue for me.