Sha256: 416752dd7f1aa1947ea4f77eb045f1e8201d57647dc118d4ef3dab867124fa61

Contents?: true

Size: 1.2 KB

Versions: 16

Compression:

Stored size: 1.2 KB

Contents

# Perform any specific account initialization such as loading Liquid tags, locales,
# etc
#------------------------------------------------------------------------------
# Register the Liquid tags for each theme.  Since tags are in the global
# Liquid namespace, we need to namespace them per theme, based on the
# account identifier
#------------------------------------------------------------------------------
ThemesForRails.available_theme_names.each do |theme_name|
  theme_data = ThemesForRails.config.theme_data[theme_name]
  theme_root = Rails.root.join('themes', theme_name)

  unless ENV['RAILS_GROUPS'] == 'assets'
    #--- Register tags from theme
    Dir.glob(File.join(theme_root, "/theme_support/tags/*.rb")).each do |path|
      require path
      file = path.split('/').last.split('.').first
      Liquid::Template.register_tag_namespace(file, "Liquid::Theme#{theme_name.camelize}::#{file.camelize}".constantize, theme_name)
    end
  end
  
  #--- add items listed in theme.yml to be pre-compiled in asset pipeline
  if Rails.env.production? || Rails.env.staging?
    if theme_data and theme_data['precompile']
      Rails.application.config.assets.precompile += theme_data['precompile']
    end
  end
  
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dm_cms-4.2.3.10 spec/dummy/config/initializers/account_initialization.rb
dm_cms-4.2.3.9 spec/dummy/config/initializers/account_initialization.rb
dm_cms-4.2.3.8 spec/dummy/config/initializers/account_initialization.rb
dm_cms-4.2.3.7 spec/dummy/config/initializers/account_initialization.rb
dm_cms-4.2.3.6 spec/dummy/config/initializers/account_initialization.rb
dm_cms-4.2.3.5 spec/dummy/config/initializers/account_initialization.rb
dm_cms-4.2.3.4 spec/dummy/config/initializers/account_initialization.rb
dm_cms-4.2.3.3 spec/dummy/config/initializers/account_initialization.rb
dm_cms-4.2.3.2 spec/dummy/config/initializers/account_initialization.rb
dm_cms-4.2.3.1 spec/dummy/config/initializers/account_initialization.rb
dm_cms-4.2.3 spec/dummy/config/initializers/account_initialization.rb
dm_cms-4.2.2.3 spec/dummy/config/initializers/account_initialization.rb
dm_cms-4.2.2.2 spec/dummy/config/initializers/account_initialization.rb
dm_cms-4.2.2.1 spec/dummy/config/initializers/account_initialization.rb
dm_cms-4.2.2 spec/dummy/config/initializers/account_initialization.rb
dm_cms-4.2.1.5 spec/dummy/config/initializers/account_initialization.rb