mirror of
https://github.com/privacyguides/privacyguides.org.git
synced 2025-07-28 14:21:08 +00:00
Add breadcrumb metadata (#2072)
This commit is contained in:
33
theme/partials/path.html
Normal file
33
theme/partials/path.html
Normal file
@@ -0,0 +1,33 @@
|
||||
{% import "partials/path-item.html" as item with context %}
|
||||
{% if page.meta and page.meta.hide %}
|
||||
{% set hidden = "hidden" if "path" in page.meta.hide %}
|
||||
{% endif %}
|
||||
{% set depth = page.ancestors | length %}
|
||||
{% if nav.homepage %}
|
||||
{% set depth = depth + 1 %}
|
||||
{% endif %}
|
||||
{% if depth > 1 %}
|
||||
{% set count = namespace(value=1) %}
|
||||
<nav class="md-path" aria-label="{{ lang.t('nav') }}" {{ hidden }}>
|
||||
<ol class="md-path__list" vocab="https://schema.org/" typeof="BreadcrumbList">
|
||||
{% if nav.homepage %}
|
||||
<li class="md-path__item" property="itemListElement" typeof="ListItem">
|
||||
{{ item.render(nav.homepage) }}
|
||||
<meta property="position" content="{{ count.value }}">
|
||||
{% set count.value = count.value + 1 %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% for nav_item in page.ancestors | reverse %}
|
||||
<li class="md-path__item" property="itemListElement" typeof="ListItem">
|
||||
{{ item.render(nav_item) }}
|
||||
<meta property="position" content="{{ count.value }}">
|
||||
{% set count.value = count.value + 1 %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
<li property="itemListElement" typeof="ListItem" hidden>
|
||||
<meta property="name" content="{{ page.title }}">
|
||||
<meta property="position" content="{{ count.value }}">
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
{% endif %}
|
Reference in New Issue
Block a user