module HomePage module LayoutHelper def breadcrumbs result = render_navigation context: :main, renderer: :breadcrumbs_without_method_links, join_with: ' > ' result = result && result.scan(' 1 ? result : '' if respond_to?(:resource) && resource.respond_to?(:ancestors) breadcrumbs_with_ancestors(result) else result end end def breadcrumbs_with_ancestors(links) links = links.split(' > ') current_resource_link = links.pop links += resource.ancestors.map {|ancestor| link_to ancestor.name, ancestor } links << current_resource_link raw links.join(' > ') end def sidenav(links_count = 2) links_count ||= 2 result = render_navigation context: :main, renderer: :twitter_sidenav, level: @twitter_sidenav_level result && result.scan('= links_count ? result : '' end end end