Use article heading if the content is an article
This commit is contained in:
parent
f731082884
commit
53595f851d
|
@ -3,10 +3,38 @@ layout: main/base
|
||||||
---
|
---
|
||||||
|
|
||||||
<header class="main__header">
|
<header class="main__header">
|
||||||
|
{% if isArticle %}
|
||||||
|
<ul class="breadcrumbs">
|
||||||
|
{% set breadcrumbNavPages = collections.all | eleventyNavigationBreadcrumb(articleTitle) %}
|
||||||
|
{%- for entry in breadcrumbNavPages %}
|
||||||
|
<li>
|
||||||
|
<a href="{{ entry.url }}" {% if entry.url == page.url %} class="breadcrumbs--active"{% endif %}>{{ entry.title }}</a>
|
||||||
|
</li>
|
||||||
|
➔
|
||||||
|
{%- endfor %}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h1>{{ articleTitle }}</h1>
|
||||||
|
<div class="article__info">
|
||||||
|
<p>Posted on {{ date | niceDate }} by {{ sitemeta.siteAuthor.name }}
|
||||||
|
{% if updated %}
|
||||||
|
• Last updated on {{ updated | niceDate }}</p>
|
||||||
|
{% endif %}
|
||||||
|
{% if categories %}
|
||||||
|
<p>Categories:
|
||||||
|
{% for cat in categories %}
|
||||||
|
<a href="/categories/{{ cat | slugify }}">{{ cat }}</a>{% if not loop.last %}, {% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
<p>{{ content | emojiReadTime }}</p>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
<h1>{{ pageTitle or title }}</h1>
|
<h1>{{ pageTitle or title }}</h1>
|
||||||
{% if desc %}
|
{% if desc %}
|
||||||
<p>{{ desc }}</p>
|
<p>{{ desc }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="content__wrapper">
|
<div class="content__wrapper">
|
||||||
|
@ -28,3 +56,14 @@ layout: main/base
|
||||||
{% include "main/content-nav.njk" %}
|
{% include "main/content-nav.njk" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.breadcrumbs {
|
||||||
|
justify-self: center;
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0 0 0.7em 0;
|
||||||
|
display: flex;
|
||||||
|
gap: 0.5em;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue