Module: Middleman::Sprockets::AssetTagHelpers

Defined in:
lib/middleman-sprockets/asset_tag_helpers.rb

Instance Method Summary collapse

Instance Method Details

#javascript_include_tag(*sources) ⇒ Object

extend padrinos javascript_include_tag with debug functionality splits up script dependencies in individual files when configuration variable :debug_assets is set to true



8
9
10
11
12
13
14
15
16
17
# File 'lib/middleman-sprockets/asset_tag_helpers.rb', line 8

def javascript_include_tag(*sources)
  if sprockets.debug_assets
    options = sources.extract_options!.symbolize_keys
    sources.map do |source|
      super(dependencies_paths('.js', source), options)
    end.join("").gsub("body=1.js", "body=1")
  else
    super
  end
end

extend padrinos stylesheet_link_tag with debug functionality splits up stylesheets dependencies in individual files when configuration variable :debug_assets is set to true



22
23
24
25
26
27
28
29
30
31
# File 'lib/middleman-sprockets/asset_tag_helpers.rb', line 22

def stylesheet_link_tag(*sources)
  if sprockets.debug_assets
    options = sources.extract_options!.symbolize_keys
    sources.map do |source|
      super(dependencies_paths('.css', source), options)
    end.join("").gsub("body=1.css", "body=1")
  else
    super
  end
end