# How to add a theme using modules (for beginners)

**URL:** https://discourse.gohugo.io/t/how-to-add-a-theme-using-modules-for-beginners/20665
**Category:** tips & tricks
**Created:** [September 8, 2019, 4:35pm UTC](https://discourse.gohugo.io/t/how-to-add-a-theme-using-modules-for-beginners/20665 "2019-09-08T16:35:37Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![divinerites](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/divinerites/32/12625_2.png) [@divinerites](https://discourse.gohugo.io/u/divinerites)
#### Post date: [August 8, 2020, 8:56am UTC](https://discourse.gohugo.io/t/how-to-add-a-theme-using-modules-for-beginners/20665/3 "2020-08-08T08:56:49Z")

</div>

Thanks all for those informations. Since [this post](https://discourse.gohugo.io/t/hugo-modules-for-dummies/20758/8) is now closed I hijack this thread to give some more hints.

After **not succeeding to use modules** even after reading those great post and the doc, even if I’m pretty comfortable with Hugo, I finally got some aha! moment when I realised that you need to understand somethings the Golang users know for a long time, but hidden for us poor mortals only using Hugo.

Do not hesitate to correct me if something is wrong or not really accurate. Here is the 2 simple things:

## The path name module.

- If you want to create/develop a module, you create your git folder `module1-hugo` as usual.
- But the name module you give **cannot** be a local name (aka `module1-hugo`).
- It has to be with a **domain name as prefix** (aka `github.com/divinerites/module1-hugo`)
- So now you can initiate the Hugo module with the command : `hugo mod init github.com/divinerites/module1-hugo`, and reference it later in your `path` directive.

## The version numbers

- Unless you’ll give a (semantic) **tag version number** (aka `v1.0.3`) to your git commit, trying to use modules will fail with diverses error messages.

If you follow those 2 basic (for Go & Go modules users) recommandations, then using Hugo Modules is easy and so powerful (thanks Bep for this fantastic implementation).

May be just 2 other things, already in those great tutorials, but better say that again here:

- A useful basic commands to **update only one module** from your internet repository : `hugo mod get -u github.com/divinerites/module1-hugo`
- When you want to update/develop locally the beauty of modules is that you just add a `replace` directive for the module in your project `go.mod`, and bim bam boum, the local module folder is in use, with a fresh Hugo reload in millisecond. No need to do the merge/push/tag/update dance. **Brilliant**.

`replace github.com/divinerites/module1-hugo => /Users/mycomputername/Documents/Git/module1-hugo`

---

_[View the full topic](https://discourse.gohugo.io/t/how-to-add-a-theme-using-modules-for-beginners/20665)._
