diff --git a/README.md b/README.md index 3d9d1a54..c491843d 100644 --- a/README.md +++ b/README.md @@ -113,3 +113,40 @@ Prepend the style of the icon you want to use (`fas`, `far`, `fab`) class to exi ```html ``` + + +## Using FontAwesome Pro + +Assuming you have purchased fontawesome pro and want to use Rails asset pipeline. + +First login to fontawesome and go to the download section. You will see two options in the download seaction, they are "Web" and "Desktop". Click on "Pro for Web" and download it. Unzip it to any tempory folder. + +#### Step 1 + +* Copy **"./css/all.css"** to you project's stylesheets directory and rename it **"app/assets/stylesheets/fontawesome.css"** +* Copy **"./js/all.js"** to your project's javascripts directory and rename it **"app/assets/javascripts/fontawesome.js"** +* Copy all the fonts from **"webfonts"** folder and place them in **"app/assets/webfonts"** folder (or just copy over the entire folder) + +#### Step 2 + +**Remove** any css settings you have done for this gem such as +* @import 'font-awesome-sprockets'; +* @import 'font-awesome'; + +Edit file **"app/assets/stylesheets/fontawesome.css"** +Search **"../webfonts/"** and replace with **"/assets/"** + +#### Step 3 + +Add the following to **"config/initializers/assets.rb"** +```ruby +Rails.application.config.assets.paths << Rails.root.join('app', 'assets', 'webfonts') +Rails.application.config.assets.precompile += %w[.svg .eot .woff .woff2 .ttf] +``` +In the class Application. And thats it. +Test it with `icon(:far, 'tachometer-alt-average')` which is a pro icon. + +#### Production + +In production don't forget to compile the assets using +`bundle exec rails assets:precompile`