Fix error with missing title to render breadcrumbs

This commit is contained in:
Helen Chong 2024-04-20 00:43:37 +08:00
parent e4e58f6e6a
commit cf4d7bdf07
1 changed files with 1 additions and 1 deletions

View File

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