forked from bevyengine/bevy-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnews.html
35 lines (35 loc) · 1.58 KB
/
news.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{% extends "layouts/base.html" %}
{% import "macros/images.html" as image_macros %}
{% block content %}
<div class="padded-content item-grid">
{% for page in section.pages %}
{% if page and not page.extra.public_draft %}
<a class="link-card" href="{{ page.path }}">
<div class="link-card__img-wrapper">
{% if page.extra.image %}
{% set image_parent = page.path | replace(from="_index.md", to="") %}
<img class="link-card__img"
src="{{ image_macros::resize_image(path=image_parent ~ page.extra.image, width=580, height=326) }}"
loading="lazy"
alt="An image representing the article" />
{% else %}
<img class="link-card__img"
src="/assets/bevy_logo_dark.svg"
loading="lazy"
alt="Bevy Engine logo"
width="520"
height="130" />
{% endif %}
</div>
<div class="link-card__content">
<h2 class="link-card__title">{{ page.title }}</h2>
<div class="link-card__subtitle">Written {{ page.date | date(format="%B %d, %Y") }} by {% if page.authors %}{% for author in page.authors %}{{ author }}{% endfor %}{% else %}Bevy Contributors{% endif %}</div>
<p class="link-card__description link-card__description--ellipsis">
{{ page.summary | striptags | truncate(length=350) | safe }}
</p>
</div>
</a>
{% endif %}
{% endfor %}
</div>
{% endblock content %}