Private modules - how to mix with public modules?

So I am finally getting the hang with this whole “Hugo Modules” thingy. And trust me, posts in this forum that have “for Dummies” or “for Beginners” in the title and talk about modules - they aren’t for real beginners :wink: It’s complicated and the documentation needs plenty of things being said that people who dream in Go might think is obvious. But we will fix that in the future.

However, I am running into the following (still theoretical) issue:

  • I have a theme module. The theme is licensed MIT.
  • I have a private fonts module. The font is licensed to me only.
  • On my own website I want to use my theme with my font.
  • On other websites I want Hugo to ignore the private module

Apart from the “how do I run the pipes without issues if the private font module is not available?” (this is a SASS issue that any “beginner” (hihi) can easily solve) how would I want to attempt to have on my website only the font module and have it not being retrieved (that will fail) from any other user of the theme module?

I already have separated the whole construction into a website-repo, a theme-repo and the fonts-repo. So my idea is to somehow add to the website-repo the info for the private module and to the theme-repo all other required modules. The issue here is, that I can’t define module configs in two of the locations, because one would overwrite all others?

Maybe I am just too blocked and miss something very easy here. Maybe Hugo (or -go) is already able to ignore “private” modules somehow?

1 Like

Due to the font module is private project, the public theme should not depend on the font module, only your website repository needs to depend on it, I think.


Great. I overlooked that we can update modules recursive via hugo mod get -u ./... - this way the theme gets its modules and the site-repo the private module. This might work.

1 Like