{%- comment -%} Include as: {%- include components/breadcrumbs.html -%} Depends on: page, site. Includes: components/site_nav.html. Results in: HTML for the breadcrumbs component. Overwrites: nav_list_link, site_nav, nav_list_simple, nav_list_link_class, nav_category, nav_anchor_splits, nav_breadcrumbs, nav_split, nav_split_next, nav_split_test, nav_breadcrumb_link, nav_list_end_less, nav_list_end_count, nav_end_index, nav_breadcrumb. {%- endcomment -%} {%- if page.url != "/" and page.parent and page.title -%} {%- capture nav_list_link -%} {%- endcapture -%} {%- capture site_nav -%} {%- include_cached components/site_nav.html all=true -%} {%- endcapture -%} {%- capture nav_list_simple -%} "s requires that number of potential ancestors to be popped from the stack. The number of occurrences of a string in nav_split_next is computed by removing them all, then dividing the resulting size difference by the length of the string. {%- endcomment %} {%- assign nav_breadcrumbs = "" | split: "" -%} {%- for nav_split in nav_anchor_splits -%} {%- unless forloop.last -%} {%- assign nav_split_next = nav_anchor_splits[forloop.index] | strip -%} {%- assign nav_split_test = nav_split_next | remove_first: nav_list_simple | prepend: nav_list_simple -%} {%- if nav_split_test == nav_split_next -%} {%- assign nav_breadcrumb_link = nav_split | split: "" | append: "" -%} {%- assign nav_breadcrumbs = nav_breadcrumbs | push: nav_breadcrumb_link -%} {%- endif -%} {%- if nav_split_next contains "" -%} {%- assign nav_list_end_less = nav_split_next | remove: "" -%} {%- assign nav_list_end_count = nav_split_next.size | minus: nav_list_end_less.size | divided_by: 5 -%} {% for nav_end_index in (1..nav_list_end_count) %} {%- assign nav_breadcrumbs = nav_breadcrumbs | pop -%} {%- endfor -%} {%- endif -%} {%- endunless -%} {%- endfor -%} {% if site.nav_error_report %} {{ nav_error_report }} {% endif %} {%- endif -%}