aboutsummaryrefslogtreecommitdiffstats
path: root/lib/alavetelitheme.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2017-10-23 16:02:20 +0100
committerLouise Crow <louise.crow@gmail.com>2017-10-23 16:02:20 +0100
commit24e140ed1197776f109a2983fafc846d69f82a80 (patch)
treef7464c5cbb45e84aaddf6ae0eed6541b1a6f808f /lib/alavetelitheme.rb
parent0dee8c3bd06dd8779500667018185fab6dcee04e (diff)
parent2bfe3de491ae721d5d57ddec3c0051108ce39c8f (diff)
Merge branch 'develop'
Diffstat (limited to 'lib/alavetelitheme.rb')
-rw-r--r--lib/alavetelitheme.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/alavetelitheme.rb b/lib/alavetelitheme.rb
index 0658142..c472d34 100644
--- a/lib/alavetelitheme.rb
+++ b/lib/alavetelitheme.rb
@@ -45,6 +45,20 @@ $alaveteli_route_extensions << 'custom-routes.rb'
Rails.application.config.assets.paths.unshift theme_asset_path
end
+# Append individual theme assets to the asset path
+theme_asset_path = File.join(File.dirname(__FILE__),
+ '..',
+ 'app',
+ 'assets')
+theme_asset_path = Pathname.new(theme_asset_path).cleanpath.to_s
+
+LOOSE_THEME_ASSETS = lambda do |logical_path, filename|
+ filename.start_with?(theme_asset_path) &&
+ !['.js', '.css', ''].include?(File.extname(logical_path))
+end
+
+Rails.application.config.assets.precompile.unshift(LOOSE_THEME_ASSETS)
+
# Tell FastGettext about the theme's translations: look in the theme's
# locale-theme directory for a translation in the first place, and if
# it isn't found, look in the Alaveteli locale directory next: