-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add horizontal card and postslist layouts
- Loading branch information
hjonin
committed
Jun 19, 2023
1 parent
0cd49d6
commit d1edc1d
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{# Mandatory variable `card { url: string, title: string, description: string, tags: string[], date: string, imagePath: string, imageAlt: string }` to make it work #} | ||
<div class="fr-card fr-enlarge-link fr-card--horizontal-tier"> | ||
<div class="fr-card__body"> | ||
<div class="fr-card__content"> | ||
<h3 class="fr-card__title"><a href="{{ card.url | locale_url }}">{{ card.title }}</a></h3> | ||
<p class="fr-card__desc">{{ card.description }}</p> | ||
<div class="fr-card__start"> | ||
{% set tags = card.tags %} | ||
{% include "components/taggroup-disabled.njk" %} | ||
<p class="fr-card__detail fr-icon-time-fill"> | ||
<time class="postlist-date" | ||
datetime="{{ card.date | htmlDateString }}">{{ card.date | readableDate("LLLL yyyy") }}</time> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
{% if card.imagePath %} | ||
<div class="fr-card__header"> | ||
<div class="fr-card__img">{% image card.imagePath, card.imageAlt %}</div> | ||
</div> | ||
{% endif %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{# Mandatory variable `postslist: CollectionItem[]` to make it work #} | ||
<div class="fr-grid-row fr-grid-row--gutters fr-mb-3w"> | ||
{% asyncAll post in postslist %} | ||
<div class="fr-col-12"> | ||
{% set card = { | ||
url: post.url, | ||
title: post.data.title, | ||
description: post.data.description, | ||
tags: post.data.tags, | ||
date: post.date, | ||
imagePath: post.data.image.path, | ||
imageAlt: post.data.image.alt | ||
} %} | ||
{% include "components/card-horizontal.njk" %} | ||
</div> | ||
{% endall %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters