Hiya
I want to strip out inline STYLE tags in files and then add these to a proxy SCSS or something
I have started on an extension that uses the manipulate resources - but I am unsure on how to complete the above - use of NokiGiri seems a good choice though.
Any help appreciated.
##
# Manipulate Resource List
##
def manipulate_resource_list( resources )
extensions = [ "html" ]
# Get all HTML resources
resources.select { | r | extensions.include?( r.path.split( '.' ).last ) }.each do | r |
if r.path == "localizable/index.html"
html = Nokogiri::HTML( r.render )
html.xpath( "//style" ).remove
html.to_html
puts html
resources.push( html )
# resources.push Middleman::Sitemap::AliasResource.new(@app.sitemap, alias_url, resource.url)
end
end
resources
end