diff --git a/lib/locomotive/liquid/tags/nav.rb b/lib/locomotive/liquid/tags/nav.rb
index 88a2d696..4a31d7ec 100644
--- a/lib/locomotive/liquid/tags/nav.rb
+++ b/lib/locomotive/liquid/tags/nav.rb
@@ -95,7 +95,7 @@ module Locomotive
def render_entry_children(page,depth)
output = %{}
- children = page.children
+ children = page.children_with_minimal_attributes.reject { |c| c.templatized? }
if children.present?
output = %{
}
children.each do |c, page|
diff --git a/spec/lib/locomotive/liquid/tags/nav_spec.rb b/spec/lib/locomotive/liquid/tags/nav_spec.rb
index 556f44a4..4474640d 100644
--- a/spec/lib/locomotive/liquid/tags/nav_spec.rb
+++ b/spec/lib/locomotive/liquid/tags/nav_spec.rb
@@ -13,7 +13,8 @@ describe Locomotive::Liquid::Tags::Nav do
other_children = [
Page.new(:title => 'Child #2.1', :fullpath => 'child_2/sub_child_1', :slug => 'sub_child_1', :published => true),
- Page.new(:title => 'Child #2.2', :fullpath => 'child_2/sub_child_2', :slug => 'sub_child_2', :published => true)
+ Page.new(:title => 'Child #2.2', :fullpath => 'child_2/sub_child_2', :slug => 'sub_child_2', :published => true),
+ Page.new(:title => 'Templatized #2.3', :fullpath => 'child_2/sub_child_template_3', :slug => 'sub_child_template_3', :published => true, :templatized => true)
]
@home.children.last.stubs(:children_with_minimal_attributes).returns(other_children)
@home.children.last.stubs(:children).returns(other_children)
@@ -43,12 +44,20 @@ describe Locomotive::Liquid::Tags::Nav do
it 'renders children to depth' do
output = render_nav('site', {}, 'depth: 2')
+
output.should match //
output.should match /- /
output.should match /<\/a>
/
output.should match /- /
+ output.should match /
- /
output.should match /<\/a><\/li><\/ul><\/li><\/ul>/
end
+
+ it 'does not render templatized pages' do
+ output = render_nav('site', {}, 'depth: 2')
+
+ output.should_not match /sub-child-template-3/
+ end
it 'adds an icon before the link' do
render_nav('site', {}, 'icon: true').should match /
- <\/span>Child #1<\/a>/