templates/blog/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block head %}
  3.     {{ parent() }}
  4.     <meta name="description" content="{{ 'BLOG_META_DESCRIPTION'|trans}}">
  5.     <meta name="keywords" content="{% for blog in blogPaginator.result %}{{ blog.title }}, {% endfor %}">
  6. {% endblock %}
  7. {% block title %}{{ 'BLOG'|trans }}{% endblock %}
  8. {% block body %}
  9. <main>
  10.     <section class="komili-home-blog">
  11.         <div class="komili-wrapper">
  12.             <h2 class="text-center bold text-color-p">{{ 'BLOG'|trans }}</h2>
  13.             <ul class="komili-home-blog-posts">
  14.                 {% for blog in blogPaginator.result %}
  15.                 <li>
  16.                     <a href="{{ path('blog_detail', {'titleSlug': blog.slug}) }}">
  17.                         <figure class="mb-16">
  18.                             <img src="{{ blog.image.url }}" alt="{{ blog.title }}" loading="lazy" width="350"
  19.                                  height="350">
  20.                         </figure>
  21.                         <h4 class="h6 bold text-color-p mb-10">{{ blog.title }}</h4>
  22.                         <p class="text-14 mb-0 text-black">{{ blog.shortContent }}</p>
  23.                     </a>
  24.                 </li>
  25.                 {% endfor %}
  26.             </ul>
  27.             <ul class="komili-pagination mt-60">
  28.                 {% for i in 1..blogPaginator.lastPage %}
  29.                 <li>
  30.                     <a href="{{ path('blog_page', {'page': i}) }}" {% if blogPaginator.currentPage == i %} class="active" {% endif %}>{{ i }}</a>
  31.                 </li>
  32.                 {% endfor %}
  33.             </ul>
  34.         </div>
  35.         {% for blog in blogPaginator.result %}
  36.             <div itemscope itemtype="http://schema.org/NewsArticle">
  37.                 <meta itemscope itemprop="mainEntityOfPage"  itemType="https://schema.org/WebPage" itemid="{{ url('blog_detail', {'titleSlug': blog.slug}) }}"/>
  38.                 <meta itemprop="headline" content="{{ blog.title }}">
  39.                 <h3 itemprop="author" itemscope itemtype="https://schema.org/Person">
  40.                     <meta itemprop="name" content="Komili">
  41.                 </h3>
  42.                 <meta itemprop="description" content="{{ blog.shortContent }}"/>
  43.                 <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
  44.                     <meta itemprop="url" content="{{ blog.image.url }}">
  45.                 </div>
  46.                 <div itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
  47.                     <div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
  48.                         <meta itemprop="url" content="{{ absolute_url('/img/komili-logo.svg') }}">
  49.                     </div>
  50.                     <meta itemprop="name" content="Komili">
  51.                 </div>
  52.                 <meta itemprop="datePublished" content="{{ blog.createdAt|date('Y-m-d') }}T{{ blog.createdAt|date('H:s') }}"/>
  53.                 <meta itemprop="dateModified" content="{{ blog.updatedAt|date('Y-m-d') }}T{{ blog.updatedAt|date('H:s') }}"/>
  54.             </div>
  55.         {% endfor %}
  56.     </section>
  57. </main>
  58. {% endblock %}