{% extends 'base.html.twig' %}
{% block title %}Hello HomeController!{% endblock %}
{% block body %}
<h1 class="text-center">Last 5 posts</h1>
<div class="container-fluid justify-content-center">
{% for post in posts %}
<div class="card text-center">
<div class="card-body">
<h5 class="card-title">{{ post.title }}</h5>
<p class="card-text">{{ post.description }}</p>
<a href="{{ path('post', {slug: post.slug}) }}" class="btn btn-primary">Read more</a>
</div>
<div class="card-footer text-muted">{{ post.publishedAt.format('Y-m-d H:i:s') }}</div>
{% endfor %}
{% endblock %}