I’m using Hugo’s built-in SCSS compilation feature, with a single entry point named main.scss
.
Here’s how I call the file:
{{ $options := (dict "targetPath" "/css/main.min.css" "outputStyle" "compressed" "enableSourceMap" true) }}
{{ $style := resources.Get "scss/main.scss" | resources.ToCSS $options }}
<link rel="stylesheet" href="{{ $style.Permalink }}">
Here’s what’s on top on my main.scss
file:
@import "node_modules/bulma/bulma";
@import "node_modules/highlight.js/styles/github-gist.css";
@import "node_modules/slick-carousel/slick/slick";
@import "variables";
@import "nav";
@import "home";
@import "about";
It seems that Hugo cannot import the regular .css file (github-gist.css
) and simply ignores it. If I go and compile/serve the site, I get no error from the command line, but in Firefox’ DevTools, I get this error when I go in the “Style Editor” tab:
Style sheet could not be loaded. http://localhost:1313/css/node_modules/highlight.js/styles/github-gist.css
Anyone has an idea how I should import that file? Or is it a bug?