Haml wrap_layout passes again
This commit is contained in:
parent
239f80c1f9
commit
e26b68635f
|
@ -330,6 +330,14 @@ module Middleman
|
||||||
# Save current buffer for later
|
# Save current buffer for later
|
||||||
@_out_buf, _buf_was = "", @_out_buf
|
@_out_buf, _buf_was = "", @_out_buf
|
||||||
|
|
||||||
|
layout_path = locate_layout(layout_name, current_engine)
|
||||||
|
|
||||||
|
extension = File.extname(layout_path)
|
||||||
|
engine = extension[1..-1].to_sym
|
||||||
|
|
||||||
|
# Store last engine for later (could be inside nested renders)
|
||||||
|
@current_engine, engine_was = engine, @current_engine
|
||||||
|
|
||||||
begin
|
begin
|
||||||
content = if block_given?
|
content = if block_given?
|
||||||
capture_html(&block)
|
capture_html(&block)
|
||||||
|
@ -341,14 +349,6 @@ module Middleman
|
||||||
@_out_buf = _buf_was
|
@_out_buf = _buf_was
|
||||||
end
|
end
|
||||||
|
|
||||||
layout_path = locate_layout(layout_name, current_engine)
|
|
||||||
|
|
||||||
extension = File.extname(layout_path)
|
|
||||||
engine = extension[1..-1].to_sym
|
|
||||||
|
|
||||||
# Store last engine for later (could be inside nested renders)
|
|
||||||
@current_engine, engine_was = engine, @current_engine
|
|
||||||
|
|
||||||
concat_content render_individual_file(layout_path, @current_locs || {}, @current_opts || {}, self) { content }
|
concat_content render_individual_file(layout_path, @current_locs || {}, @current_opts || {}, self) { content }
|
||||||
ensure
|
ensure
|
||||||
@current_engine = engine_was
|
@current_engine = engine_was
|
||||||
|
|
|
@ -6,6 +6,7 @@ Feature: Allow nesting of layouts
|
||||||
Then I should see:
|
Then I should see:
|
||||||
"""
|
"""
|
||||||
Master
|
Master
|
||||||
|
<h1>Index Title</h1>
|
||||||
Outer
|
Outer
|
||||||
Inner
|
Inner
|
||||||
Template
|
Template
|
||||||
|
@ -15,7 +16,7 @@ Feature: Allow nesting of layouts
|
||||||
Then I should see:
|
Then I should see:
|
||||||
"""
|
"""
|
||||||
Master
|
Master
|
||||||
New Article Title
|
<h1>New Article Title</h1>
|
||||||
Outer
|
Outer
|
||||||
Inner
|
Inner
|
||||||
<p>The Article Content</p>
|
<p>The Article Content</p>
|
||||||
|
@ -36,10 +37,9 @@ Feature: Allow nesting of layouts
|
||||||
Then I should see:
|
Then I should see:
|
||||||
"""
|
"""
|
||||||
Master
|
Master
|
||||||
New Article Title
|
<h1>New Article Title</h1>
|
||||||
Outer
|
Outer
|
||||||
Inner
|
Inner
|
||||||
|
|
||||||
<p>The Article Content</p>
|
<p>The Article Content</p>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -1 +1,6 @@
|
||||||
|
---
|
||||||
|
title: "Index Title"
|
||||||
|
layout: inner
|
||||||
|
---
|
||||||
|
|
||||||
Template
|
Template
|
|
@ -1,3 +1,3 @@
|
||||||
Master
|
Master
|
||||||
<%= data.page.title %>
|
<h1><%= data.page.title %></h1>
|
||||||
<%= yield %>
|
<%= yield %>
|
|
@ -1,3 +1,3 @@
|
||||||
Master
|
Master
|
||||||
= data.page.title
|
%h1= data.page.title
|
||||||
= yield
|
= yield
|
Loading…
Reference in a new issue