I have created a website in Hugo and would now like to add Bootstrap to it.
I assume that what I want to do is to add a module. This is where my woes start. I simply cannot understand the documentation on that subject, including other threads on this forum.
What I want to do is add GitHub - gohugoio/hugo-mod-bootstrap-scss: Packages Bootstrap SCSS (v4 and v5) as a Hugo Module to my project.
So far I have installed Hugo (of course), Git and Go.
I have added the module to config.yaml:
module:
imports:
- path: github.com/gohugoio/hugo-mod-bootstrap-scss/v5
I have imported it in my .css-file:
@import “bootstrap/bootstrap”;
I have initialised my own site:
hugo mod init website
This gave the error message:
“WARN 2023/09/15 13:20:10 module “github.com/gohugoio/hugo-mod-bootstrap-scss/v5” not found; either add it as a Hugo Module or store it in “/website/themes”.: module does not exist
go: creating new go.mod: module website
go: to add module requirements and sums:
go mod tidy”
(“add it as a Hugo Module” – thanks, I’m actually trying!)
It also created a go.mod file containing the text:
module website
go 1.21.1
I then tried:
hugo mod get github.com/gohugoio/hugo-mod-bootstrap-scss/v5
This added the line:
require github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20003 // indirect
To my go.mod file.
However, none of this actually seems to mean that I have access to the module, and I still see no Bootstrap files. Am I supposed to download them manually somewhere along the way?
The documentation on github says:
The Bootstrap SCSS will be mounted in assets/scss/bootstrap
And the official documentation says:
Modules will be downloaded and added when you add them as imports to your configuration, see Module Imports.
When and how is this supposed to take place?
I am at a loss at how to proceed and hope that some of all you lovely people can help me.