{% extends "base.html" %}

{% block description %}
{% if not subtitle %}
{{ _("Find out our tips and tricks about email marketing. We prepared some soft and some hard skills here. Ready to dive in?") }}
{% else %}
{{ _("You're interested in") }} {{ subtitle }}? {{ _("We're here to serve you:") }}
{% endif %}
{% endblock %}

{% block content %}
<div class="container">
  <h1>{% block title %}Blog {{ subtitle|default('', true) }} {% endblock %}</h1>
  {% for post in posts %}
  <div class="row align-items-center">
    <div class="col-3">
      <img src={{ post.coverImage.url }} class="img-thumbnail align-middle">
    </div>
    <div class="col-8 mx-auto">
      <div class="post-preview">
        <a href="{{ url_for('blog.get_post', post_slug=post.slug) }}">
          <h2 class="post-title">
            {{ post.title }}
          </h2>
          <h3 class="post-subtitle">
            {{ post.excerpt }}
          </h3>
        </a>
        <p class="post-meta"> {{ post.date }}
          {% for tag in post.tags %}
          <a href={{url_for('blog.get_posts_from_tag', tag=tag)}}>{{ tag }}</a>
          {% endfor %}
        </p>
      </div>
    </div>
    <hr>
  </div>
  {% endfor %}

</div>
{% endblock %}
