Need help to get https://github.com/hugo-mods/icons up and running

Hello, I want to use the hugo-mods/icons

I get this error message when calling hugo mod get -u

hugo mod get -u     
go: no module dependencies to download
go: github.com/hugo-mods/icons: invalid github.com import path "github.com/hugo-mods"
Error: failed to get ["-d" "-u" "github.com/hugo-mods/icons"]: failed to execute 'go [get -d -u github.com/hugo-mods/icons]': failed to execute binary "go" with args [get -d -u github.com/hugo-mods/icons]: go: github.com/hugo-mods/icons: invalid github.com import path "github.com/hugo-mods"
 *errors.errorString

go.mod shows:

module github.com/hugo-mods/icons

go 1.19

hugo evn shows:

hugo v0.111.3+extended freebsd/amd64 BuildDate=2023-03-17T03:01:46Z+0000 VendorInfo=freebsd
GOOS="freebsd"
GOARCH="amd64"
GOVERSION="go1.20.3"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.2.4"

go version shows:

go version go1.19.7 freebsd/amd64

Any idea what goes wrong?

Please post your site configuration file and the go.mod file from the root of your project.

Hallo,

go.mod content was posted already above.

Here is the content of my config.toml file (removed baseURL and title).

baseURL = 'xxx'
languageCode = 'en-us'
title = 'xxx'
theme="archie"
enableRobotsTXT = "true"

[module]
[[module.imports]]
  path = "github.com/hugo-mods/icons"

[params]
	Victor_Hugo = "true"
	Focus_Keyword = ""
	mode="toggle"
	useCDN=false
	subtitle = ""
[[menu.main]]
name = "All posts"
url = "/posts/"
weight = 2

[[menu.main]]
name = "Impress"
url = "/impress"
weight = 3

[[menu.main]]
name = "Tags"
url = "/tags"
weight = 4

Yeah, I wanted to confirm this, because the go.mod file in the root of your project is wrong.

module github.com/hugo-mods/icons

Your site module has the same name as the module you are importing.

And how should it be?

Give it a name unique to your project.

hugo mod init foo/bar

Looks like I lack some base understanding how modules work / what modules are …
Do you know a tutorial somewhere giving just some basic understanding?

Hugo modules are Go modules. Digital Ocean’s intro is pretty good:
https://www.digitalocean.com/community/tutorials/how-to-use-go-modules

Hello,

sorry again me.

I still have some problems. I followed the steps here: GitHub - hugo-mods/icons: A Hugo icon system module that scales.

They write:

Initialize Hugo’s mod system on your site:

hugo mod init github.com/<username>/<your-repo>

I struggle already here. I don’t have my site on github but locally on my PC. What should it look like then?

I’m in my hugo website folder:
Should I do this then such as hugo mod init ~/hugo_site/icons

And what path should I put in my toml file?

This link helped me:

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