Allow non-article pages to add breadcrumbs

This commit is contained in:
Leilukin 2024-04-19 23:50:12 +08:00 committed by Helen Chong
parent 0038813cf5
commit fed0de6c7a

View File

@ -1,5 +1,4 @@
<header class="main__header"> <header class="main__header">
{% if isArticle %}
{% if eleventyNavigation %} {% if eleventyNavigation %}
<ul class="breadcrumbs"> <ul class="breadcrumbs">
{% set breadcrumbNavPages = collections.all | eleventyNavigationBreadcrumb(articleTitle) %} {% set breadcrumbNavPages = collections.all | eleventyNavigationBreadcrumb(articleTitle) %}
@ -12,6 +11,8 @@
</ul> </ul>
{% endif %} {% endif %}
{% if isArticle %}
<h1>{{ articleTitle }}</h1> <h1>{{ articleTitle }}</h1>
<div class="article__info"> <div class="article__info">
<p>Posted on {{ date | niceDate }} by {{ sitemeta.siteAuthor.name }} <p>Posted on {{ date | niceDate }} by {{ sitemeta.siteAuthor.name }}