Fix error with missing title to render breadcrumbs

This commit is contained in:
Leilukin 2024-04-20 00:43:37 +08:00 committed by Helen Chong
parent a85cab05a0
commit 7d4cffe9ee

View File

@ -1,7 +1,7 @@
<header class="main__header">
{% if isArticle or hasBreadcrumbs %}
<ul class="breadcrumbs">
{% set breadcrumbNavPages = collections.all | eleventyNavigationBreadcrumb(articleTitle) %}
{% set breadcrumbNavPages = collections.all | eleventyNavigationBreadcrumb(articleTitle or title) %}
{%- for entry in breadcrumbNavPages %}
<li>
<a href="{{ entry.url }}" {% if entry.url == page.url %} class="breadcrumbs--active"{% endif %}>{{ entry.title }}</a>