3

I've just started learning Grav CMS and wanted to use FontAwesome Pro with the sites I've made, I do have a license and all the necessary files.

I've added fontawesome-all.min.css to /user/plugins/admin/themes/grav/templates/partials/base.html.twig and the CSS file loads just fine on the site. But all the webfonts return 404 my base.html.twig now contains this

{% extends 'partials/base-root.html.twig' %}
{% do assets.addCss('theme://css/fontawesome-all.min.css') %}

I put the css in a css folder, on the same level as the css folder (in the g5_helium theme folder, I'm using Gantry 5 as well). yet chrome (or any other browser) fails to load the FA font files returning 404.

the path from my CSS file to the webfonts are the same as the path specified in the FA CSS file. I've attached output from my terminal where I print 1 line from one of the webfont files to prove that the path should, in my view, be correct.

➜  g5_helium git:(master) ✗ cd css; ls
fontawesome-all.min.css
➜  css git:(master) ✗ echo "examplepath from css file" 
examplepath from css file
➜  css git:(master) ✗ tail -n 1 ../webfonts/fa-solid-900.ttf 
window-alt  window-closewindow-maximizewindow-minimizewindow-restore�windowon-sign�wrenchx-rayen-sign% 

The path in the FA-all.css file is the same, output from file

url("../webfonts/fa-solid-900.ttf") format("truetype")
  • Do you really want to edit the admin theme, or the theme for your website? – Jacobm001 Apr 06 '18 at 15:43
  • Just the theme for my website, after having asked in RocketTheme forums as well is seems the best thing to do now is to load the old and the new FA together. they said they were working on adding support for FA5 any how the solution when using Gantry 5 for me was to go to website settings for my site and add it in the page setting for base layout. I'm not used to doing things in gui so had great trouble finding this. my manual additions were removed when gantry upgraded –  May 20 '18 at 18:34

1 Answers1

0

Can you supply the order you have everything, you may need to try and set the fontawesome .css above your custom.css for it to work. At least that's how they show it on the documentation.

C. Morett
  • 45
  • 1
  • 6