Reputation: 1639
I am using middleman with the middleman-slim package to generate a static website. If I have a partial in a file named _test.erb
or _test.slim
, I can simply include it with the line
== partial 'layouts/test'
However, if this is just a plain .html file, it doesn't work. I've searched around with relatively little success. The options I can think of so far are:
==IO.read('source/layouts/_test.html')
), which is also uglyIs there a way I can register a handler for plain .html files to make this work in a simple way?
Upvotes: 2
Views: 858
Reputation: 23873
This is currently an open issue with Middleman: https://github.com/middleman/middleman/issues/1206
Check the link for up do date info and a couple of workarounds.
My personal approach would be to create a simple helper for IO.read
or sprockets.find_asset
.
UPD: Thomas Reynolds has fixed this for you! Wait for Middleman 3.3.4 to be released or use it from Github via Bundler:
gem 'middleman', :git => '[email protected]:middleman/middleman.git', :branch => 'v3-stable'
Upvotes: 2