module Jekyll::Assets::Plugins::SrcMap

Constants

DIR
DIR_NAME
EXT
NAME

Public Class Methods

map_path(env:, asset:) click to toggle source

– @return [String] the map name. Take the path, and attach the map extension. @note this just saves logic. –

# File lib/jekyll/assets/plugins/srcmap.rb, line 24
def self.map_path(env:, asset:)
  [
    path({
      asset: asset,
      env: env,
    }),
    EXT,
  ].join
end
path(env:, asset:) click to toggle source

– @note this is used for anything in source-maps. Strip the filename and return a relative sourcemap path. @return [Pathutil] the path. –

# File lib/jekyll/assets/plugins/srcmap.rb, line 39
def self.path(env:, asset:)
  DIR.join(env.strip_paths(asset.is_a?(Sprockets::Asset) ?
    asset.filename : asset))
end