Module: Jekyll::Filters::Breadcrumbs
- Defined in:
- lib/jekyll/filters/breadcrumbs.rb
Instance Method Summary collapse
-
#breadcrumbs(input, field) ⇒ Array
The breadcrumbs filter returns an Array of Jekyll::Documents that are linked recursively by the same field.
Instance Method Details
#breadcrumbs(input, field) ⇒ Array
The breadcrumbs filter returns an Array of Jekyll::Documents that are linked recursively by the same field.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/jekyll/filters/breadcrumbs.rb', line 12 def (input, field) return unless input.respond_to? :[] crumbs = [ input ] prev = input while prev&.public_send(:[], field) crumbs << (prev = prev[field]) end crumbs.reverse end |