Class: Middleman::VersionsExtension
- Inherits:
-
Extension
- Object
- Extension
- Middleman::VersionsExtension
- Defined in:
- lib/middleman/versions/extension.rb
Instance Method Summary collapse
- #after_configuration ⇒ Object
-
#initialize(app, options_hash = {}, &block) ⇒ VersionsExtension
constructor
A new instance of VersionsExtension.
Constructor Details
#initialize(app, options_hash = {}, &block) ⇒ VersionsExtension
Returns a new instance of VersionsExtension.
8 9 10 |
# File 'lib/middleman/versions/extension.rb', line 8 def initialize(app, ={}, &block) super end |
Instance Method Details
#after_configuration ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/middleman/versions/extension.rb', line 13 def after_configuration app.config[:versions_options] = versions_list = .versions.map{|x| x[:decorated_name]} versions_paths = .versions.map{|x| x[:decorated_name] + "/" + .destination_template} .versions.each do |version| full_version_path = .versions_path + version[:path] version_data = Versions::FileHandler::load_file(full_version_path) current_path = "#{version[:decorated_name]}/#{.destination_template}" app.proxy "#{current_path}", "/#{.origin_template}", :locals => { :versions_paths => versions_paths, :versions_list => versions_list, :version_data => version_data , :current_version => version[:decorated_name], :current_path => "#{current_path}" }, :ignore => true end end |