From c9fe8befd9e258f917fe5256491d216519c55faa Mon Sep 17 00:00:00 2001 From: Saimon Lovell Date: Tue, 17 Sep 2019 22:30:40 -0400 Subject: [PATCH 1/6] Update README.md Step 1 of fontawesome pro --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 3d9d1a54..85362823 100644 --- a/README.md +++ b/README.md @@ -113,3 +113,17 @@ 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/fonts" folder + From 35d35b0c73ddc281032f97871b0b585190af9610 Mon Sep 17 00:00:00 2001 From: Saimon Lovell Date: Tue, 17 Sep 2019 23:09:15 -0400 Subject: [PATCH 2/6] Update README.md Step 2 and 3 of using pro --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 85362823..8f473387 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,18 @@ First login to fontawesome and go to the download section. You will see two opti ### 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/fonts" folder +* 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 +### Step 2 + +**Remove** any css settings you have done for this gem such as +* @import 'font-awesome-sprockets'; +* @import 'font-awesome'; + +### Step 3 + +Add the following to **"config/application.rb"** +`config.assets.paths << Rails.root.join('app', 'assets', 'webfonts')` +In the class Application From bc58803b9a1754838afcd165d6810ed1e7e80ad5 Mon Sep 17 00:00:00 2001 From: Saimon Lovell Date: Tue, 17 Sep 2019 23:18:52 -0400 Subject: [PATCH 3/6] Update README.md Final step and production setup. --- README.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8f473387..72400c3e 100644 --- a/README.md +++ b/README.md @@ -121,20 +121,28 @@ 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 +#### 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 +* Copy all the fonts from **"webfonts"** folder and place them in **"app/assets/webfonts"** folder (or just copy over the entire folder) -### Step 2 +#### Step 2 **Remove** any css settings you have done for this gem such as * @import 'font-awesome-sprockets'; * @import 'font-awesome'; -### Step 3 +#### Step 3 Add the following to **"config/application.rb"** -`config.assets.paths << Rails.root.join('app', 'assets', 'webfonts')` -In the class Application +```ruby +config.assets.paths << Rails.root.join('app', 'assets', 'webfonts') +``` +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` From 98d215e3b171f4c325743df323141320f3e9b92c Mon Sep 17 00:00:00 2001 From: Saimon Lovell Date: Wed, 18 Sep 2019 08:59:03 -0400 Subject: [PATCH 4/6] Update README.md Update for rails 5 asset pipeline --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 72400c3e..3ec2a962 100644 --- a/README.md +++ b/README.md @@ -133,11 +133,15 @@ First login to fontawesome and go to the download section. You will see two opti * @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/application.rb"** +Add the following to **"config/initializers/assets.rb"** ```ruby -config.assets.paths << Rails.root.join('app', 'assets', 'webfonts') +Rails.application.config.assets.paths << Rails.root.join('app', 'assets', 'webfonts') +Rails.application.config.assets.precompile << /\.(?:svg|eot|woff|woff2|ttf)\z/ ``` In the class Application. And thats it. Test it with `icon(:far, 'tachometer-alt-average')` which is a pro icon. From 7cafb03343722d8133f393fc861826bb7d10fcef Mon Sep 17 00:00:00 2001 From: Saimon Lovell Date: Wed, 18 Sep 2019 08:59:57 -0400 Subject: [PATCH 5/6] Update README.md refactor --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3ec2a962..a59e62b0 100644 --- a/README.md +++ b/README.md @@ -133,8 +133,8 @@ First login to fontawesome and go to the download section. You will see two opti * @import 'font-awesome-sprockets'; * @import 'font-awesome'; -Edit file "app/assets/stylesheets/fontawesome.css" -Search **"../webfonts"** and replace with **"/assets"** +Edit file **"app/assets/stylesheets/fontawesome.css"** +Search **"../webfonts/"** and replace with **"/assets/"** #### Step 3 From 0de0d33835a93c61cf99f8ea94dd950d7658938d Mon Sep 17 00:00:00 2001 From: Saimon Lovell Date: Mon, 14 Oct 2019 21:33:33 -0400 Subject: [PATCH 6/6] Update README.md rails 5.2.3 asset update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a59e62b0..c491843d 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ Search **"../webfonts/"** and replace with **"/assets/"** 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 << /\.(?:svg|eot|woff|woff2|ttf)\z/ +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.