{% extends "index" %}
{% block content %}
<div class="news maxWidthLimit">
    {% for newsElement in craft.entries.section('news').all() %}

    {% set image = newsElement.images.one() %}
    <a href="{{newsElement.url}}" class="news-item">
        <div class="news-thumbnail">
            <img src="{{ craft.app.sites.primarySite.baseUrl }}/{{image.url}}" alt="{{image.title}}">
        </div>
        <div class="news-details">
            <h3 class="news-heading">{{newsElement.title}}</h3>
            <p class="news-teaser">
                {{ newsElement.shortDescription|length > 100 ? newsElement.shortDescription|slice(0, 100) ~ '...'
                :newsElement.shortDescription }}
            </p>
        </div>
    </a>

    {% endfor %}
</div>
{% endblock %}