Closed robertwbradford closed 8 years ago
Hmmm, yeah I know I have used that in a few places to dump svgs as well. I'll look into it -- for now you should be able to do this though:
topic_image = extensions[:sprockets].environment.find_asset(topic_image_path) ? topic_image_path : default_topic_image_path
That code sample, exposing that var to the template sandbox, should work.
Yep, @robertwbradford if you use the gem from master you should be good now:
gem 'middleman-sprockets', github: 'middleman/middleman-sprockets'
Beauty! I'll have to look at this later, but thanks for the change. Middleman has been a great platform to work in, btw.
I see in
v4.0.0.rc.1
that this is using the new pattern for Middleman extensions. I've been working to update an app fromv3
and realized I'm using something like the following in one of my layouts to see if an image exists before including a default image:However, because the new version of the extension only exposes the
sprockets
instance to the config file, I'm getting an error. Is adding the following a possibility if I were to do a PR?Or is there a better way to accomplish this?