ect
ect copied to clipboard
Support passing of blocks and content to partials
Partials are nice but it is difficult to pass in a huge block of html to a partial.
Say we have this template 'test.ect'
<div class="houses">
<% content %>
</div>
then it would be cool to do something like:
<% include "test.ect" : %>
<div>A</div>
<% end %>
<% include "test.ect" : %>
<div>B</div>
<% end %>
I relied on this a lot in Jade. Would be a good addition.
It appears that something like this is possible now:
test.ect
<div class="houses">
<% content 'test-content' %>
</div>
other.ect
<% block 'test-content' : %>
<div>A</div>
<% end %>
<% include 'test' %>
Admittedly this is a workaround, and can't be used more than once because of #79.