Sha256: 76601710f233a7cebaea9612fe288e1e09850ca2a0950f6d40719da161c41963
Contents?: true
Size: 648 Bytes
Versions: 14
Compression:
Stored size: 648 Bytes
Contents
module SimpleNavigation module Renderer # Renders the 'chain' of selected navigation items as simple text items, # joined with an optional separator (similar to breadcrumbs, but without # markup). class Text < SimpleNavigation::Renderer::Base def render(item_container) list(item_container).compact.join(options[:join_with] || ' ') end private def list(item_container) item_container.items.keep_if(&:selected?).map do |item| [item.name(apply_generator: false)] + (include_sub_navigation?(item) ? list(item.sub_navigation) : []) end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems