Skip to content

Commit

Permalink
Don't show index if not present
Browse files Browse the repository at this point in the history
  • Loading branch information
ndbroadbent committed Feb 29, 2012
1 parent f5b9cae commit 69b7c1d
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions lib/guides/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,19 @@ def set_index(body, view, processor)
index << view.content_tag(:li, link.html_safe + children_ul.html_safe)
end

index_section = <<-INDEX
<div id="subCol">
<h3 class="chapter"><img src="images/chapters_icon.gif" alt="" />Chapters</h3>
<ol class="chapters">
#{index}
</ol>
</div>
INDEX

view.content_for(:index_items) { index.html_safe }
view.content_for(:index_section) { index_section.html_safe }
if index != ""
index_section = <<-INDEX
<div id="subCol">
<h3 class="chapter"><img src="images/chapters_icon.gif" alt="" />Chapters</h3>
<ol class="chapters">
#{index}
</ol>
</div>
INDEX

view.content_for(:index_section) { index_section.html_safe }
view.content_for(:index_items) { index.html_safe }
end

i.result
end
Expand Down

0 comments on commit 69b7c1d

Please sign in to comment.