7
7
# ShinyCMS is free software; you can redistribute it and/or modify it under the terms of the GPL (version 2 or later)
8
8
9
9
# Version of your assets, change this if you want to expire all your assets.
10
- Rails . application . config . assets . version = '2021.02.14.0800 '
10
+ Rails . application . config . assets . version = '2021.05.07.1700 '
11
11
12
12
# Add node_modules directory to the asset load path.
13
13
# Rails.application.config.assets.paths << Rails.root.join( 'node_modules' )
@@ -24,11 +24,23 @@ def available_themes
24
24
end
25
25
26
26
def add_theme_to_asset_load_path ( theme_name )
27
+ add_theme_images_to_asset_load_path ( theme_name )
28
+ add_theme_styles_to_asset_load_path ( theme_name )
29
+ end
30
+
31
+ def add_theme_images_to_asset_load_path ( theme_name )
32
+ images_dir = Rails . root . join "themes/#{ theme_name } /images"
33
+ return unless Dir . exist? images_dir
34
+
35
+ Rails . application . config . assets . paths << images_dir
36
+ end
37
+
38
+ def add_theme_styles_to_asset_load_path ( theme_name )
27
39
stylesheets_dir = Rails . root . join "themes/#{ theme_name } /stylesheets"
28
- images_dir = Rails . root . join "themes/ #{ theme_name } /images"
40
+ return unless Dir . exist? stylesheets_dir
29
41
30
- Rails . application . config . assets . paths << stylesheets_dir if Dir . exist? stylesheets_dir
31
- Rails . application . config . assets . paths << images_dir if Dir . exist? images_dir
42
+ Rails . application . config . assets . paths << stylesheets_dir
43
+ Rails . application . config . assets . precompile += %W[ #{ theme_name } .css ]
32
44
end
33
45
34
46
add_all_themes_to_asset_load_path
0 commit comments