Sha256: 41820008087de18d8c0803a85de32360badec89b67e47a2b5b68db931da57954

Contents?: true

Size: 670 Bytes

Versions: 1

Compression:

Stored size: 670 Bytes

Contents

# stdlib
require "set"

module Jekyll
  module AssetsPlugin
    module Patches
      module ContextPatch
        def site
          self.class.instance_variable_get :@site
        end

        def jekyll_assets
          @jekyll_assets ||= Set.new
        end

        def asset_path(pathname, *args)
          pathname = pathname.to_s.strip

          return "" if pathname.empty?

          asset = resolve(pathname[/^[^#?]+/]).to_s
          jekyll_assets << asset

          site.asset_path(asset, *args) + (pathname[/[#?].+/] || "")
        rescue Sprockets::FileNotFound
          raise Environment::AssetNotFound, pathname
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jekyll-assets-0.14.0 lib/jekyll/assets_plugin/patches/context_patch.rb