class NavGenerator::Generator

Public Instance Methods

generate(site) click to toggle source

Generate a sorted page heirarchy based on parent / grand_parent TODO: If a new page is added to the site, need to hook into incremental rebuild and flush nav.html cache

# File lib/generators/nav-generator.rb, line 5
def generate(site)
  nav = nav_for_parent(site.pages, nil)
  
  # Attach nav data to the default layout
  site.layouts['default'].data['nav'] = nav
end
nav_for_parent(page_list, parent) click to toggle source