-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
Current behaviour
In its current incarnation, the capturing helper is cut-and-paste. That is to say that the following
<p>Some text before</p>
<% content_for :summary do %>
<p>On this item, Nanoc is introduced, blah blah.</p>
<% end %>
<p>Some text after</p>
will output
<p>Some text before</p>
<p>Some text after</p>
If one wants the captured text where it was written, one has to paste it right after cutting it
<p>Some text before</p>
<% content_for :summary do %>
<p>On this item, Nanoc is introduced, blah blah.</p>
<% end %>
<%= content_for(@item, :summary) %>
<p>Some text after</p>
Or course <%= content_for(..., :summary) %> would be used elsewhere!
Desired behavior
But I have a use case where a paragraph is used as an introduction on several different pages. It would be nice to have an option to avoid typing <%= content_for(@item, :summary) %> just after the capturing context. Maybe something like.
<p>Some text before</p>
<% content_for :summary, cut: false do %>
<p>On this item, Nanoc is introduced, blah blah.</p>
<% end %>
<p>Some text after</p>
which would result in
<p>Some text before</p>
<p>On this item, Nanoc is introduced, blah blah.</p>
<p>Some text after</p>
as well as capturing the paragraph to be reused elsewhere. I.e. copy-and-paste.
Fjan