templates/blog/index.html.twig

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block body_id 'blog_index' %}
  3. {% block main %}
  4.     {% for post in posts %}
  5.         <article class="post">
  6.             <h2>
  7.                 <a href="{{ path('blog_post', {slug: post.slug}) }}">
  8.                     {{ post.title }}
  9.                 </a>
  10.             </h2>
  11.             <p class="post-metadata">
  12.                 <span class="metadata"><i class="fa fa-calendar"></i> {{ post.publishedAt|localizeddate('long', 'medium', null, 'UTC') }}</span>
  13.                 <span class="metadata"><i class="fa fa-user"></i> {{ post.author.fullName }}</span>
  14.             </p>
  15.             <p>{{ post.summary }}</p>
  16.             {{ include('blog/_post_tags.html.twig') }}
  17.         </article>
  18.     {% else %}
  19.         <div class="well">{{ 'post.no_posts_found'|trans }}</div>
  20.     {% endfor %}
  21.     {% if posts.haveToPaginate %}
  22.         <div class="navigation text-center">
  23.             {{ pagerfanta(posts, 'twitter_bootstrap3_translated', {routeName: 'blog_index_paginated', routeParams: app.request.query.all}) }}
  24.         </div>
  25.     {% endif %}
  26. {% endblock %}
  27. {% block sidebar %}
  28.     {{ parent() }}
  29.     {{ show_source_code(_self) }}
  30.     {{ include('blog/_rss.html.twig') }}
  31. {% endblock %}