doc/themes/yunohost-docs/templates/partials/breadcrumbs.html.twig
2020-11-14 16:37:58 +01:00

38 lines
1.8 KiB
Twig

{% set crumbs = breadcrumbs.get() %}
{% set breadcrumbs_config = config.plugins.breadcrumbs %}
{% set divider = breadcrumbs_config.icon_divider_classes %}
{% if crumbs|length > 1 or breadcrumbs_config.show_all %}
<div id="breadcrumbs" itemscope itemtype="http://schema.org/BreadcrumbList">
{% if breadcrumbs_config.icon_home %}
<a href="{{ url("/") }}"><i class="{{ breadcrumbs_config.icon_home }}"></a></i><i class="{{ divider }}"></i>
{% endif %}
{% for crumb in crumbs %}
<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
{% if not loop.last %}
{% if crumb.routable %}
<a itemscope itemtype="http://schema.org/Thing" itemprop="item" href="{{ crumb.url }}" itemid="{{ crumb.url }}">
<span itemprop="name">{{ crumb.menu }}</span>
</a>
{% else %}
<span itemscope itemtype="http://schema.org/Thing" itemprop="item" itemid="{{ crumb.url }}">
<span itemprop="name">{{ crumb.menu }}</span>
</span>
{% endif %}
<i class="{{ divider }}"></i>
{% else %}
{% if breadcrumbs_config.link_trailing %}
<a itemscope itemtype="http://schema.org/Thing" itemprop="item" href="{{ crumb.url }}" itemid="{{ crumb.url }}">
<span itemprop="name">{{ crumb.menu }}</span>
</a>
{% else %}
<span itemscope itemtype="http://schema.org/Thing" itemprop="item" itemid="{{ crumb.url }}">
<span itemprop="name">{{ crumb.menu }}</span>
</span>
{% endif %}
{% endif %}
<meta itemprop="position" content="{{ loop.index }}" />
</span>
{% endfor %}
</div>
{% endif %}