I’m trying to integrate plausible on my Hugo site using the theme component / hugo module from Divinerites.
I want to install this as a Hugo module, which is the reccommended method according to the readme.
I’m having some issues getting modules to work, which I assume might be do to the fact that I don’t fully understand how they work. I’ve read the documentation here and also checked out some articles such as the one by the New Dynamic. (Sorry had to remove the link as it appears new users are limited to max 2 links per post.)
Some information regarding how I use Hugo:
- Develop locally on my MacBook (using Hugo extended)
- Push changes to GitHub
- Deploy from GitHub to Netlify
Steps I’ve taken so far:
Initialized my site as a Hugo module with hugo mod init GitHub Name/GitHub Project
Installed Go, git through Homebrew. Everything is up-to-date.
Used hugo mod get -u to get the Plausible module from GitHub. It seems this step was successful, as hugo created both go.mod and go.sum files.
Updated the config.toml with the relevant entries:
[module] [[module.imports]] path = "github.com/divinerites/plausible-hugo" disabled = false [[module.import.mounts]] source = 'github.com/divinerites/plausible-hugo/layouts/partials' target = 'layouts/partials' [[module.mounts]] source = 'content' target = 'content' [[module.mounts]] source = 'static' target = 'static' [[module.mounts]] source = 'layouts' target = 'layouts' [[module.mounts]] source = 'data' target = 'data' [[module.mounts]] source = 'assets' target = 'assets' [[module.mounts]] source = 'i18n' target = 'i18n' [[module.mounts]] source = 'archetypes' target = 'archetypes'
What I don’t understand:
Where are the files for module? Mounting through config.toml didn’t seem to work.
What happens when I update the module through the command line? Do the local files get overwritten?
Is installing modules this way compatible with deploying through Netlify?
I’d appreciate any help or guidance you can provide.