funkydan2 / alpha-church

Hugo theme for churches based on a html5up theme
https://alpha-church.netlify.app
Other
67 stars 58 forks source link

FA icons not working #2

Closed rsouthpaw closed 6 years ago

rsouthpaw commented 6 years ago

Fa icons were working when I was using hugo version 37. When I upgraded hugo version 42, icons stopped working.

funkydan2 commented 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.

rsouthpaw commented 6 years ago

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!

funkydan2 commented 6 years ago

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!