From a94591fe78c4253a4db48c1438f685a506ff3903 Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 21 Sep 2018 13:46:50 +0200 Subject: [PATCH] Loads custom fonts before default ones Also includes a .keep file inside fonts/custom folder to track the directory by git --- app/assets/fonts/custom/.keep | 0 config/initializers/assets.rb | 9 ++++++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 app/assets/fonts/custom/.keep diff --git a/app/assets/fonts/custom/.keep b/app/assets/fonts/custom/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index e5fc916f0..6a07a9324 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -15,6 +15,9 @@ Rails.application.config.assets.precompile += %w( stat_graphs.js ) Rails.application.config.assets.precompile += %w( print.css ) Rails.application.config.assets.precompile += %w( ie.css ) -# Loads app/assets/images/custom before app/assets/images -images_path = Rails.application.config.assets.paths -images_path = images_path.insert(0, Rails.root.join("app", "assets", "images", "custom").to_s) +# Loads custom images and custom fonts before app/assets/images and app/assets/fonts +assets_path = Rails.application.config.assets.paths + +%w[images fonts].each do |asset| + assets_path.insert(0, Rails.root.join("app", "assets", asset, "custom").to_s) +end