the import build_parent_template regex was missing nested layouts. Test theme has two new pages to test this.

This commit is contained in:
Dirk Kelly 2011-03-03 07:50:22 +08:00
parent 97e3ddb6e3
commit 9145540ef0
3 changed files with 2 additions and 5 deletions

View File

@ -91,13 +91,10 @@ module Locomotive
def build_parent_template(template)
# just check if the template contains the extends keyword
fullpath = template.scan(/\{% extends (\w+) %\}/).flatten.first
fullpath = template.scan(/\{%\s*extends\s*\'([^\']+)\'\s*%\}/).flatten.first
if fullpath # inheritance detected
fullpath.gsub!("'", '')
return if fullpath == 'parent'
self.add_page(fullpath)
end
end

Binary file not shown.

View File

@ -53,7 +53,7 @@ describe Locomotive::Import::Job do
end
it 'inserts all the pages' do
@site.pages.count.should == 9
@site.pages.count.should == 11
end
it 'inserts the index and 404 pages' do