Closed Aetherus closed 8 years ago
Looks like Sprockets is processing ERb instead of Middleman. You should be able to tell it not to like so:
sprockets.engines.delete('.erb')
@tdreyno sprockets.engines
is a frozen hash.
:disappointed: Okay, I'll dig keeping into their API.
Same issue with js.erb files.
No updates? :(
+1
There is no maintainer for this repo, currently. Sorry, without that, there won't be much progress.
@annael I think thats a separate, but related issue. The way I'm seeing it, that's the same as https://github.com/middleman/middleman/issues/1801 (just think if your file was js.coffee.erb
). It seems like a fairly sticky issue because of expectations on which engine (middleman or sprockets) should render which files -- or in this case if middleman should render, then pass off to sprockets. (think if it was js.coffee.erb
). I'm hoping that passing middleman's template context over to sprockets will alleviate most cases this would be an issue.
For the original issue (html.erb
), I think we should limit what output file types sprockets should be handling. I'll definitely keep that in mind & report back when I get a chance to work on the context passing.
Sure thing. For starters the .html.erb
in js could be solved checking file types here -- probably just looking at the base/output extension. .css
& .js
being the obvious ones but maybe others are valid for sprockets not middleman to handle?
For context passing, I haven't quite figured out a good way to handle it -- but somewhere in the sprockets context eval the middleman template context needs to be included (or it's helpers at least). It gets kinda tricky though since that's a class -- and sprocket's expectation is to be including modules.
hey @Aetherus , with #93 merged your original issue should be resolved on master. please re-open and let me know if you continue to see issues.
I use
middleman 4.0.0
withmiddleman-sprockets 4.0.0.rc.1
to build my static site.When I try to call helper methods (e.g.
url_for
) from some*.html.erb
file injs_dir
, I got error saying that the helper method is not defined.If I remove the
middleman-sprockets
fromGemfile
, then there is no error when building. But I really want the//= require xxx
feature.Here is the error log:
Is there any workaround?