HUGO

Do I need to re-add modules when using cloned repositories?

I have a hugo site that is being hosted on Github Pages.

I set it up on my laptop and it is pushing from there. I just cloned the repository to my desktop and when I run hugo server, it throws errors due to the eureka theme I installed using the hugo mod approach described here: Getting Started - Hugo Eureka | Tech Mansion

So do I need to install the hugo mod on each clone of the repository? I don’t want to do anything on my desktop copy until I know I am not going to blow things up somehow.

Once the modules have been configured in your project they are stored in a go.mod file at the root of your project’s repo, therefore once you clone the repo and run the hugo command, they will be found automatically without needing to do re-add them.

Also have a look at the documentation regarding

Except that it isn’t working out that way.

On my laptop - I type hugo server and it works.

On my desktop - I type hugo server and I get a ton of errors regarding the module. I ran hugo vendor, hugo mod clean, hugo verify, and the rest of the cleanup type commands and still getting these:

Building sites … ERROR 2021/12/01 16:38:40 render of "page" failed: execute of template failed: template: _default/single.html:3:4: executing "_default/single.html" at <partial "head" .>: error calling partial: "/home/tknx/mysite/_vendor/wangchucheng.com/hugo-eureka/layouts/partials/head.html:53:10": execute of template failed: template: partials/head.html:53:10: executing "partials/head.html" at <partial "get-title" .>: error calling partial: partial "get-title" not found
ERROR 2021/12/01 16:38:40 render of "page" failed: execute of template failed: template: _default/single.html:3:4: executing "_default/single.html" at <partial "head" .>: error calling partial: "/home/tknx/mysite/_vendor/wangchucheng.com/hugo-eureka/layouts/partials/head.html:53:10": execute of template failed: template: partials/head.html:53:10: executing "partials/head.html" at <partial "get-title" .>: error calling partial: partial "get-title" not found
ERROR 2021/12/01 16:38:40 render of "page" failed: execute of template failed: template: _default/single.html:3:4: executing "_default/single.html" at <partial "head" .>: error calling partial: "/home/tknx/mysite/_vendor/wangchucheng.com/hugo-eureka/layouts/partials/head.html:53:10": execute of template failed: template: partials/head.html:53:10: executing "partials/head.html" at <partial "get-title" .>: error calling partial: partial "get-title" not found
ERROR 2021/12/01 16:38:40 render of "page" failed: execute of template failed: template: _default/single.html:3:4: executing "_default/single.html" at <partial "head" .>: error calling partial: "/home/tknx/mysite/_vendor/wangchucheng.com/hugo-eureka/layouts/partials/head.html:53:10": execute of template failed: template: partials/head.html:53:10: executing "partials/head.html" at <partial "get-title" .>: error calling partial: partial "get-title" not found
Built in 31 ms
Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: _default/single.html:3:4: executing "_default/single.html" at <partial "head" .>: error calling partial: "/home/tknx/mysite/_vendor/wangchucheng.com/hugo-eureka/layouts/partials/head.html:53:10": execute of template failed: template: partials/head.html:53:10: executing "partials/head.html" at <partial "get-title" .>: error calling partial: partial "get-title" not found

I deleted my above replies and re-opened just to be sure.

After cloning the repo did you execute the following?
hugo mod get -u

The command hugo mod get resolves all module dependencies. The -u flag installs the latest versions of all modules.

If you executed the above after a fresh clone of the project repo and you still encounter the error you described, then you need to share the project in question because the full context needs to be seen.

Okay - I tried the hugo mod get -u without luck

Repository is here:

It is for a webnovel…

I just cloned your project and simply executed hugo server

Everything looks fine on my end.

(base) alex@alex thethousandkingdoms-main % hugo server
Start building sites … 
hugo v0.90.0-DEV+extended darwin/arm64 BuildDate=unknown

                   | EN  
-------------------+-----
  Pages            | 34  
  Paginator pages  | 11  
  Non-page files   |  1  
  Static files     |  1  
  Processed images | 10  
  Aliases          |  3  
  Sitemaps         |  1  
  Cleaned          |  0  

Built in 33 ms
Watching for changes in /Users/alex/Downloads/thethousandkingdoms-main/{_vendor,archetypes,content,layouts,static}
Watching for config changes in /Users/alex/Downloads/thethousandkingdoms-main/config/_default, /Users/alex/Downloads/thethousandkingdoms-main/go.mod
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

Could it be something about the fact that my initial version is on Mac and my second one is on Windows Subsystem for Linux Ubuntu?

I did a fresh clone and same issues. So it is definitely something weird - maybe platform specific

Perhaps someone else with a Windows workstation can look into it.

I am a Mac user also.

So - answer is it is something wonky with WSL.

I installed scoop, hugo, and git for Windows and it runs just fine.

1 Like

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