Sha256: 8d27d2148dbcbce6aad4dfa2efe66d90e9505a910da3a6326440bc6ada59ba50

Contents?: true

Size: 626 Bytes

Versions: 17

Compression:

Stored size: 626 Bytes

Contents

# 3rd-party
require "sprockets"

module Jekyll
  module AssetsPlugin
    module Patches
      module IndexPatch
        def self.included(base)
          base.class_eval do
            alias_method :__orig_find_asset, :find_asset
            alias_method :find_asset, :__wrap_find_asset
          end
        end

        def __wrap_find_asset(path, options = {})
          __orig_find_asset(path, options).tap do |asset|
            asset.instance_variable_set :@site, @environment.site if asset
          end
        end
      end
    end
  end
end

Sprockets::Index.send :include, Jekyll::AssetsPlugin::Patches::IndexPatch

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
jekyll-assets-0.14.0 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.13.0 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.12.1 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.12.0 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.11.0 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.10.1 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.10.0 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.9.2 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.9.1 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.9.0 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.8.1 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.8.0 lib/jekyll/assets_plugin/patches/index_patch.rb
tgfa-jekyll-assets-0.7.9.2 lib/jekyll/assets_plugin/patches/index_patch.rb
tgfa-jekyll-assets-0.7.9.1 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.7.9 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.7.8 lib/jekyll/assets_plugin/patches/index_patch.rb
jekyll-assets-0.7.7 lib/jekyll/assets_plugin/patches/index_patch.rb