Here what I have done:
$ go mod init developer
$ hugo mod tidy
$ hugo server
The first mistake was to import the icons in the styles.css
/* import the necessary Bootstrap files */
@import "bootstrap/functions";
@import "bootstrap/variables";
@import "bootstrap-icons/bootstrap-icons.css";
hugo.toml
[module]
[[module.imports]]
path = "github.com/gohugoio/hugo-mod-bootstrap-scss/v5"
[[module.imports]]
path = "github.com/twbs/icons"
[[module.imports.mounts]]
source = "icons"
target = "assets/icons"
The second mistake was, that I have changed the module name from example.com to developer. I used the command
go mod init developer
hugo mod tidy
Than I get the error message:
Error: error building site: process: readAndProcessContent: “/home/code-server/Workspace/developer/content/en/brand-guidelines.md:8:1”: failed to extract shortcode: template for shortcode “row” not found
Do I change back from developer to example.com in the go.mod Hugo works fine. Why I can’t change module name?
The icons are located in /public/assets/icons. Now the icons only need to be included in the head.html.
hugo server
Watching for changes in /home/code-server/Workspace/developer/{archetypes,content,data,i18n,themes}
Watching for config changes in /home/code-server/Workspace/developer/hugo.toml, /home/code-server/Workspace/developer/go.mod
Start building sites …
hugo v0.124.0-629f84e8edfb0b1b743c3942cd039da1d99812b0+extended linux/amd64 BuildDate=2024-03-16T15:44:32Z VendorInfo=gohugoio
ERROR TOCSS-DART: failed to transform “/scss/styles.a6e1309d9da3dd5f4341014b25fb2b9ae7429db81a1c2a0e6839972a941b7a3f.scss” (text/x-scss): “/home/code-server/Workspace/developer/themes/developer/assets/scss/styles.scss:4:8”: Can’t find stylesheet to import.
Built in 108 ms
Ho do I right? This example doesn’t work.
<!-- Dart Sass -->
{{ $opts := dict "transpiler" "dartsass" }}
{{ $scss := resources.Get "scss/styles.scss" | fingerprint }}
{{ $fonts := resources.Get "css/font-icons.css"}}
{{ $styles := $scss | resources.ToCSS $opts }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" />