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
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
hugo mod init test
#add this to config.toml:
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.