fix: h3 for cards on home, improve card-blog include by setting scoped defaults
This commit is contained in:
parent
0b277fd5f2
commit
7f66c709ca
3 changed files with 8 additions and 14 deletions
|
|
@ -1,12 +1,13 @@
|
||||||
|
{% set headingLevel = headingLevel | default("h2") %}
|
||||||
|
{% set definedDate = definedDate | default(item.date) %}
|
||||||
|
{% set showTags = showTags | default(true) %}
|
||||||
|
|
||||||
<custom-card clickable>
|
<custom-card clickable>
|
||||||
<h2 slot="headline" class="text-step-2">
|
<{{ headingLevel }} slot="headline" class="text-step-2">
|
||||||
<a href="{{ item.url | url }}">{{ item.data.title }}</a>
|
<a href="{{ item.url | url }}">{{ item.data.title }}</a>
|
||||||
</h2>
|
</{{ headingLevel }}>
|
||||||
<span slot="date"> {% include "partials/date.njk" %} </span>
|
<span slot="date"> {% include "partials/date.njk" %} </span>
|
||||||
{%
|
{% if showTags and item.data.tags.length > 1 %}
|
||||||
if
|
|
||||||
item.data.tags.length > 1
|
|
||||||
%}
|
|
||||||
<div slot="tag" webc:nokeep>
|
<div slot="tag" webc:nokeep>
|
||||||
{% for tag in item.data.tags %}
|
{% for tag in item.data.tags %}
|
||||||
{% if tag != "posts" %}
|
{% if tag != "posts" %}
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,6 @@ permalink: 'blog/{% if pagination.pageNumber >=1 %}page-{{ pagination.pageNumber
|
||||||
|
|
||||||
<custom-masonry layout="50-50">
|
<custom-masonry layout="50-50">
|
||||||
{% asyncEach item in pagination.items %}
|
{% asyncEach item in pagination.items %}
|
||||||
{% set definedDate = item.date %}
|
|
||||||
|
|
||||||
{% include "partials/card-blog.njk" %}
|
{% include "partials/card-blog.njk" %}
|
||||||
{% endeach %}
|
{% endeach %}
|
||||||
</custom-masonry>
|
</custom-masonry>
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ blog:
|
||||||
<div class="section__inner flow region">
|
<div class="section__inner flow region">
|
||||||
<h1 class="text-center" style="color: var(--color-light);">{{ title }}</h1>
|
<h1 class="text-center" style="color: var(--color-light);">{{ title }}</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% svg "divider/waves", null, "seperator" %}
|
{% svg "divider/waves", null, "seperator" %}
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|
@ -38,18 +37,14 @@ blog:
|
||||||
<section class="full | region">
|
<section class="full | region">
|
||||||
<div class="wrapper flow prose">
|
<div class="wrapper flow prose">
|
||||||
<h2>{{ blog.title }}</h2>
|
<h2>{{ blog.title }}</h2>
|
||||||
<!-- blog intro text is optional. -->
|
|
||||||
|
|
||||||
{% if blog.intro %}
|
{% if blog.intro %}
|
||||||
<p>{{ blog.intro }}</p>
|
<p>{{ blog.intro }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="feature | region region-space-l">
|
<div class="feature | region region-space-l">
|
||||||
<custom-masonry layout="50-50">
|
<custom-masonry layout="50-50">
|
||||||
<!-- loop posts -->
|
|
||||||
{% set itemList = collections.allPosts %}
|
{% set itemList = collections.allPosts %}
|
||||||
{% asyncEach item in itemList.slice(0, 4) %}
|
{% asyncEach item in itemList.slice(0, 4) %}
|
||||||
{% set definedDate = item.date %}
|
{% set headingLevel = "h3" %}
|
||||||
{% include "partials/card-blog.njk" %}
|
{% include "partials/card-blog.njk" %}
|
||||||
{% endeach %}
|
{% endeach %}
|
||||||
</custom-masonry>
|
</custom-masonry>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue