Launching exampleSite with cohub

I’m using a Macbook with Ventura.

I’m trying to launch the exampleSite (so that I can construct my site building from that code) and I’m getting this error: Error: module "coHub" not found; either add it as a Hugo Module or store it in "/Users/jamesades/jva/themes/coHub/exampleSite/themes"

I return to the root of my project (jva) and run the code hugo mod init but I get Error: failed to init modules: binary with name "go" not found

This is what my directory looks like:

. I created a submodule called coHub, but coHub was also saved under themes. I’ve tried running the exampleSite from both, but I receive that same error warning.

I would think that I should be able to cd into exampleSite and run hugo server. Clearly, I’m missing an important point.

I’ve searched for an answer, and this is what comes closest, but I don’t think it’s really dealing with my issue.

See https://gohugo.io/installation/macos/#prerequisites

Go is required to:

  • Use the Hugo Modules feature
  • Build Hugo from source

https://go.dev/doc/install

Thanks, so I downloaded go, but I’m still having trouble initializing a Hugo module…if I’m using the code hugo mod init github.com/<your_user>/<your_project>, is <your_user> the user name of git and then <your_project> the root of the project (jva). I’ve tried that and I’ve also tried the username of my computer, neither seems to work.

I’m having a difficult time understanding what you are doing. It would be helpful if you could share your project with us (the entire repository).

Okay, so this is my root project (is that what you mean by repository?). I’ve only used git to try to connect git to Netlify to ultimately host my webpage. But yeah, for now, just trying to view the example website (exampleSite), so that I can then alter the code to create my own website accordingly (with the coHub theme: GitHub - StaticMania/hugo-cohub).

No… I meant access to your project repository on Github or GitLab.

Okay, took some time to get everything sorted with Git since they are no longer allowing terminal logins, so here is my git repo: GitHub - Jades1/netlify

image

First, screen shots are not helpful. In the future, provide a URL to the project repository. See:
https://discourse.gohugo.io/t/requesting-help/9132

Second, I still have no idea why you are referring to Go modules, unless it is in your project (not the theme)—and you have not provided access to your project. https://github.com/Jades1/netlify is not a project; I’m not sure what it is.

Third, this works fine:

hugo new site foo
cd foo
git init
git clone --recurse-submodules https://github.com/StaticMania/hugo-cohub themes/cohub
echo "theme = 'cohub'" >> config.toml
cd themes/cohub/exampleSite/
hugo server --theme ../..
1 Like

Okay, thanks for the link. Will only provide link to repository in the future.

I thought the project was public and therefore anyone had access. (Sorry, I’m very knowledgable about github, though I do plan on learning more).

Yes, that did work fine. Thank you very much for that code. I was just using hugo server rather than hugo server --theme ../... I’ve been playing around with the example site and it is quite amazing!

Thanks much!

They do, just not with a password. You need to create a personal access token and use that in place of your password.

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