{% props items: Vec<(String, String)> %}
{#- items: (text, href), root first; the last is the current page. More than four collapse the middle into an ellipsis linking to the last hidden level. -#}
{%- let collapse = items.len() > 4 %}
{%- let hidden_href = if collapse { items[items.len() - 3].1.clone() } else { String::new() } %}
<nav aria-label="Breadcrumb">
<ol class="ui-breadcrumb">
{%- for (i, (text, href)) in items.iter().enumerate() %}
{%- if !collapse || i == 0 || i + 2 >= items.len() %}
{%- if i > 0 %}
<li class="ui-breadcrumb-sep" aria-hidden="true"><svg class="ui-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></li>
{%- end %}
{%- if i + 1 == items.len() %}
<li><span aria-current="page">{{ text }}</span></li>
{%- else %}
<li><a href="{{ href }}">{{ text }}</a></li>
{%- end %}
{%- if collapse && i == 0 %}
<li class="ui-breadcrumb-sep" aria-hidden="true"><svg class="ui-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></li>
<li><a class="ui-breadcrumb-ellipsis" href="{{ hidden_href }}" aria-label="More"><svg class="ui-icon" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></svg></a></li>
{%- end %}
{%- end %}
{%- end %}
</ol>
</nav>