Issues with hugo on new laptop

I built a hugo website that I use as my tech blog. My laptop started having issues so I had to change it. Since I host the blog on Github pages my entire website folder is in a repository. On my new laptop I cloned the repository and I tried to go into my normal workflow with “hugo new content” however I get this error: “Error: Unable to locate config file or config directory. Perhaps you need to create a new site.
Run hugo help new for details.”
My configuration file that I have always used (hugo.toml ) is in the website directory. How can I solve this issue?
My blog github repo

I have tried creating a new site with with “hugo new site” then copying the contents of the github repo in it but it is not working. I verified that Git, Go, and Hugo are all installed

This worked fine for me:

git clone --recurse-submodules https://github.com/K-Scorpio/scorpiosec
cd scorpiosec/
hugo new content content/foo.md

Content “/home/jmooring/temp/scorpiosec/content/en/content/foo.md” created

1 Like

Sadly this is not working for me, now when I try to do hugo new content food.md I get Error: failed to resolve "content" to a archetype template and when I try to do hugo server to look at the site I get a bunch of errors.

Start building sites … 
hugo v0.92.2+extended linux/amd64 BuildDate=2023-01-31T11:11:57Z VendorInfo=ubuntu:0.92.2-1ubuntu0.1
ERROR 2024/02/02 20:12:02 render of "page" failed: execute of template failed: template: _default/single.html:4:11: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/kscorpio/Desktop/scorpiosec/layouts/partials/head.html:24:55": execute of template failed: template: partials/head.html:24:55: executing "partials/head.html" at <resources.ToCSS>: error calling ToCSS: no Resource provided in transformation
ERROR 2024/02/02 20:12:02 render of "page" failed: execute of template failed: template: _default/single.html:4:11: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/kscorpio/Desktop/scorpiosec/layouts/partials/head.html:24:55": execute of template failed: template: partials/head.html:24:55: executing "partials/head.html" at <resources.ToCSS>: error calling ToCSS: no Resource provided in transformation
ERROR 2024/02/02 20:12:02 render of "page" failed: execute of template failed: template: _default/single.html:4:11: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/kscorpio/Desktop/scorpiosec/layouts/partials/head.html:24:55": execute of template failed: template: partials/head.html:24:55: executing "partials/head.html" at <resources.ToCSS>: error calling ToCSS: no Resource provided in transformation
ERROR 2024/02/02 20:12:02 render of "page" failed: execute of template failed: template: _default/single.html:4:11: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/kscorpio/Desktop/scorpiosec/layouts/partials/head.html:24:55": execute of template failed: template: partials/head.html:24:55: executing "partials/head.html" at <resources.ToCSS>: error calling ToCSS: no Resource provided in transformation
Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: _default/single.html:4:11: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/kscorpio/Desktop/scorpiosec/layouts/partials/head.html:24:55": execute of template failed: template: partials/head.html:24:55: executing "partials/head.html" at <resources.ToCSS>: error calling ToCSS: no Resource provided in transformation
Built in 51 ms

You’re running an older version. Upgrade to v0.122.0.

1 Like

It is working thanks!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.