Open illycz opened 1 year ago
Hi illycz,
I had a similar spec. I created a breadcrumb component and include this is my templates. I then used an Nunjucks 'If Expression' to check if it was on the last (current) page and just render the title for that.
{% set crumbs = collections.all | eleventyNavigationBreadcrumb(eleventyNavigation.key, { includeSelf: true }) %} {% for crumb in crumbs %} {% if page.url === crumb.url %} {{ crumb.title }} {%- else -%} <a class="crumb" href="{{ crumb.url | url }}">{{ crumb.title }}</a> » {%- endif -%} {% endfor %}
(Due Credit: I got the base of my code from Mark Volkmann )
Hi illycz,
I had a similar spec. I created a breadcrumb component and include this is my templates. I then used an Nunjucks 'If Expression' to check if it was on the last (current) page and just render the title for that.
(Due Credit: I got the base of my code from Mark Volkmann )