Closed rsouthpaw closed 6 years ago
Do the icons fail only when you’re in the development environment (i.e. you run hugo server
)?
If so, I think this is a bug in hugo which is effecting the way this theme loads external libraries.
I checked the console and I was getting following error:
Access to CSS stylesheet at 'https://use.fontawesome.com/releases/v%!s(%3Cnil%3E)/css/all.css' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 400.
I just replaced
href=\"//use.fontawesome.com/releases/v%s/css/all.css\"
with
href=\"//use.fontawesome.com/releases/v5.1.0/css/all.css\"
Now icons are working!
That error is because Hugo isn’t pulling in the data from data/libs.toml. I’ve used this method to make it easier for users to change/update the external libraries they’re using in one place rather than digging through various HTML files.
But thinking a bit more, the bug in Hugo shouldn’t effect you if you’re developing a normal site (i.e. the theme is a sub directory of the site, rather than how exampleSite is a sub directory of the theme).
However, you’ve worked out the other way around...so that’s good too!
Fa icons were working when I was using hugo version 37. When I upgraded hugo version 42, icons stopped working.