Open pixelchef opened 8 years ago
Extensions have changed a bit in Middleman 4, especially how you register them and pass options. I'll do a thing.
I have the extension recompiling SVG:s on file change now, so that part's back to normal. However, it seems the entire asset pipeline was yanked for version 4 and it's basically undocumented at the moment which means a bunch of headaches and sifting through the abstractions in middleman-core. I have some stuff to figure out:
I'm going to contact the middleman core team and see if they can help me out.
Alright @pixelchef, I've got https://github.com/varvet/middleman-scavenger/pull/11 baking now and I'm trying to get word from the middleman team here: https://github.com/middleman/middleman/issues/1801
It's definitely not perfect yet but it's usable if you inline the sprite sheet. Add this to your application's Gemfile
to use the beta branch:
gem 'middleman-scavenger', git: 'https://github.com/varvet/middleman-scavenger.git', branch: 'feature/middleman-4-support'
Then put this as the first thing inside your body tag:
<%= inline_svg_sprite %>
You should then be able to use the svg
helper like in the documentation. Once I figure out how to make the vendored javascript available, I'll merge the branch into master and do a new release.
Progress on the JS file is blocked but this PR has it working again. Hopefully it will be merged soon, but until that happens you can include some pre-release versions of the gems. In your Gemfile
:
gem 'middleman-sprockets', git: 'https://github.com/stevenosloan/middleman-sprockets', branch: 'give_sprockets_access_to_middleman_helpers'
gem 'middleman-scavenger', git: 'https://github.com/varvet/middleman-scavenger', branch: 'feature/middleman-4-support'
And put this in config.rb
:
set :sprockets_expose_middleman_helpers, true
then you should be able to use the gem like it says in the README.
That's in master now. Heads up though, there was a change with configuring the option. You'll do it on activation now, so in config.rb
:
activate :sprockets do |c|
c.expose_middleman_helpers = true
end
:+1:
I keep getting this runtime error after following your included installation documentation. I see then when attempting to run middleman:
local/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in
rescue in block (2 levels) in require': There was an error while trying to load the gem 'middleman-scavenger'. (Bundler::GemRequireError)`