A hugo mod beginner

Hello,

I have been using Hugo for a while now, with a hobbeled theme installed at the root of my Hugo project.

I am now in the process of a refresh using a 3rd-party theme (hugo-narrow). I initially went down the route of using git submodules, but now want to use hugo mod.

Having no experience with hugo mod I suspect I am not getting the results that I think should occur. The theme’s documentation describes the steps one needs to take. When I execute hugo mod get github.com/tom2almighty/hugo-narrow I expected the theme to be pulled into my project. But that does not occur. The only change is a new go.sum file is created:

tree .
.
β”œβ”€β”€ archetypes
β”‚   └── default.md
β”œβ”€β”€ assets
β”œβ”€β”€ content
β”œβ”€β”€ data
β”œβ”€β”€ go.mod
β”œβ”€β”€ go.sum
β”œβ”€β”€ hugo.yaml
β”œβ”€β”€ i18n
β”œβ”€β”€ layouts
β”œβ”€β”€ static
└── themes

My assumption is that hugo mod get should pull the repository into my project.

  1. Is my assumption correct?
  2. What am I missing with using hugo mod?
  3. Should I manually run git clone?

My environment:

  • MacOS 15.7.3 (Apple Silicon)
  • go version go1.25.5 darwin/arm64
  • hugo v0.154.5+extended+withdeploy darwin/arm64 BuildDate=2026-01-11T20:53:23Z VendorInfo=Homebrew
  • git version 2.52.0

Thanks!

  1. No - It will pull the mdoule into it’s virtual filesystem - the files are stored in a module cache
  2. the docs :wink:
    Use Hugo Modules
  3. No - If you want a copy just for reference clone that anywhere you like - but NOT in the themes folder

You will find the module in the cache hugo config | grep cache- browse the folder reported as cachedir

check the above mentioned doc for hugo mod vendor to see how you can bind to a specific version. so you can build offline

1 Like

Thanks for your explanation. It helped clear up most of my confusion.

The other part of my confusion was that hugo mod get would not return any information when executed earlier today, in contradiction to what I have seen in other posts. But now it is returning:

> hugo mod get github.com/tom2almighty/hugo-narrow
go: downloading github.com/tom2almighty/hugo-narrow v1.2.2
go: added github.com/tom2almighty/hugo-narrow v1.2.2

I do recall that GitHub was intermittently showing the unicorn error earlier today. Maybe hugo mod get fails quietly if GitHub is offline. I would have to test it later.

For now, I am good to go.

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