lib/trestle/engine.rb in trestle-0.8.13 vs lib/trestle/engine.rb in trestle-0.9.0

- old
+ new

@@ -1,18 +1,18 @@ +require "sprockets/railtie" + module Trestle class Engine < ::Rails::Engine isolate_namespace Trestle self.routes.default_scope = {} # Application assets - config.assets.precompile << "trestle/admin.css" << "trestle/admin.js" + config.assets.precompile << "trestle/admin.css" << "trestle/admin.js" << "trestle/custom.css" # Vendor assets %w(eot svg ttf woff woff2).each do |ext| - config.assets.precompile << "trestle/bootstrap-sass/assets/fonts/bootstrap/glyphicons-halflings-regular.#{ext}" - config.assets.precompile << "trestle/font-awesome/fonts/fontawesome-webfont.#{ext}" - config.assets.precompile << "trestle/ionicons/fonts/ionicons.#{ext}" + config.assets.precompile << "trestle/fa-*.#{ext}" end initializer "trestle.automount" do |app| if Trestle.config.automount app.routes.prepend do @@ -22,9 +22,17 @@ end initializer "trestle.draper" do |app| if defined?(Draper) Draper::CollectionDecorator.delegate :current_page, :total_pages, :limit_value, :entry_name, :total_count, :offset_value, :last_page? + end + end + + initializer "trestle.theme" do |app| + # Enable theme compilation + if Trestle.config.theme + app.config.assets.paths << root.join("frontend/theme").to_s + app.config.assets.precompile << "trestle/theme.css" end end initializer "trestle.turbolinks" do |app| # Optional turbolinks