Merge commit '24664e4bbab4d1805b8c23509798e4305032ebe5'
This commit is contained in:
commit
3a5fc69a71
5 changed files with 23 additions and 2 deletions
|
@ -7,3 +7,13 @@ Feature: Allow nesting of layouts
|
||||||
And I should see "Inner"
|
And I should see "Inner"
|
||||||
And I should see "Outer"
|
And I should see "Outer"
|
||||||
And I should see "Master"
|
And I should see "Master"
|
||||||
|
|
||||||
|
Scenario: YAML Front Matter isn't clobbered with nested layouts
|
||||||
|
Given the Server is running at "nested-layout-app"
|
||||||
|
When I go to "/data-one.html"
|
||||||
|
Then I should see "Page Number One"
|
||||||
|
When I go to "/data-two.html"
|
||||||
|
Then I should see "Page Number Two"
|
||||||
|
When I go to "/data-one.html"
|
||||||
|
Then I should see "Page Number One"
|
||||||
|
When I go to "/data-two.html"
|
||||||
|
|
5
fixtures/nested-layout-app/source/data-one.html.erb
Normal file
5
fixtures/nested-layout-app/source/data-one.html.erb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Page Number One
|
||||||
|
layout: outer
|
||||||
|
---
|
||||||
|
Page #1
|
5
fixtures/nested-layout-app/source/data-two.html.erb
Normal file
5
fixtures/nested-layout-app/source/data-two.html.erb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Page Number Two
|
||||||
|
layout: outer
|
||||||
|
---
|
||||||
|
Page #2
|
|
@ -1,2 +1,3 @@
|
||||||
Master
|
Master
|
||||||
|
<%= data.page.title %>
|
||||||
<%= yield %>
|
<%= yield %>
|
|
@ -16,7 +16,7 @@ module Middleman::Extensions
|
||||||
if !@sitemap_tree_cache.has_key?(key)
|
if !@sitemap_tree_cache.has_key?(key)
|
||||||
auto_hash = Hash.new{ |h,k| h[k] = Hash.new &h.default_proc }
|
auto_hash = Hash.new{ |h,k| h[k] = Hash.new &h.default_proc }
|
||||||
|
|
||||||
app.sitemap.all_paths.each do |path|
|
sitemap.all_paths.each do |path|
|
||||||
next if !regex.nil? && !path.match(regex)
|
next if !regex.nil? && !path.match(regex)
|
||||||
sub = auto_hash
|
sub = auto_hash
|
||||||
path.split( "/" ).each{ |dir| sub[dir]; sub = sub[dir] }
|
path.split( "/" ).each{ |dir| sub[dir]; sub = sub[dir] }
|
||||||
|
|
Loading…
Add table
Reference in a new issue