byceps/blueprints/site/homepage/templates/site/homepage/_news.html
{%- from 'macros/homepage.html' import render_continuative_link %}
<h2>{{ _('News') }}</h2>
{%- if news_teasers %}
<ol class="block items">
{%- for teaser in news_teasers %}
<li>
<a class="card item-link" href="{{ url_for('news.view', slug=teaser.slug) }}">
{%- if teaser.featured_image %}
{%- with featured_image = teaser.featured_image %}
<div class="card-image">
<img src="{{ featured_image.url_path }}"{% if featured_image.alt_text %} alt="{{ featured_image.alt_text }}"{% endif %}>
</div>
{%- endwith %}
{%- endif %}
<div class="card-content">
<div class="item-title">{{ teaser.title }}</div>
<div class="item-meta">{{ teaser.published_at|dateformat('full') }}</div>
</div>
</a>
</li>
{%- endfor %}
</ol>
{%- else %}
<div class="block dimmed centered">{{ _('No news yet.') }}</div>
{%- endif %}
{{ render_continuative_link(url_for('news.index'), _('All news')) }}