Sha256: 15ae02cb1ddbf47136b214bf6d187d741e605882359663666e19a82c13e19b11

Contents?: true

Size: 1.41 KB

Versions: 9

Compression:

Stored size: 1.41 KB

Contents

{%- comment -%}
  Include as: {%- include components/breadcrumbs.html -%}
  Depends on: page, site.
  Results in: HTML for the breadcrumbs component.
  Overwrites:
    pages_list, parent_page, grandparent_page.
{%- endcomment -%}

{%- if page.url != "/" and page.parent -%}

  {%- assign pages_list = site[page.collection]
      | default: site.html_pages
      | where_exp: "item", "item.title != nil"
      | where_exp: "item", "item.has_children != nil" -%}

  {%- if page.grand_parent -%}
    {%- assign parent_page = pages_list
        | where: "title", page.parent
        | where: "parent", page.grand_parent
        | first -%}
    {%- assign grandparent_page = pages_list
        | where: "title", page.grand_parent
        | first -%}
  {%- else -%}
    {%- assign parent_page = pages_list
        | where: "title", page.parent
        | where_exp: "item", "item.parent == nil"
        | first -%}
  {%- endif -%}

<nav aria-label="Breadcrumb" class="breadcrumb-nav">
  <ol class="breadcrumb-nav-list">
  {% if page.parent -%}
  {%- if page.grand_parent %}
    <li class="breadcrumb-nav-list-item"><a href="{{ grandparent_page.url | relative_url }}">{{ page.grand_parent }}</a></li>
  {%- endif %}
    <li class="breadcrumb-nav-list-item"><a href="{{ parent_page.url | relative_url }}">{{ page.parent }}</a></li>
  {% endif -%}
    <li class="breadcrumb-nav-list-item"><span>{{ page.title }}</span></li>
  </ol>
</nav>

{%- endif -%}

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
just-the-docs-0.6.2 _includes/components/breadcrumbs.html
just-the-docs-0.6.1 _includes/components/breadcrumbs.html
just-the-docs-0.6.0 _includes/components/breadcrumbs.html
just-the-docs-0.5.4 _includes/components/breadcrumbs.html
just-the-docs-peter-0.1.3 _includes/components/breadcrumbs.html
just-the-docs-peter-0.1.2 _includes/components/breadcrumbs.html
just-the-docs-peter-0.1.1 _includes/components/breadcrumbs.html
just-the-docs-0.5.3 _includes/components/breadcrumbs.html
just-the-docs-0.5.2 _includes/components/breadcrumbs.html