{% paginate blog.articles by 12 %}

<div class="top_section_header">
  <header class="section-header text-center" style="{% if section.settings.main_banner != blank %}background-image: url({{ section.settings.main_banner | img_url: 'x500' }});{% else %}background-image: url({{ 'about_page.jpg' | asset_url }});{% endif %}">
    <h1>{{ page_title }}</h1>
    {% comment %}
    {% if blog.tags.size > 0 %}
    <div class="blog-filter">
      <label class="blog-filter__label select-label" for="BlogTagFilter">{{ 'collections.filters.title_tags' | t }}</label>
      <div class="select-group">
        <select id="BlogTagFilter" aria-describedby="a11y-refresh-page-message a11y-selection-message" data-blog-tag-filter>
          <option value="{{ blog.url }}">{{ 'blogs.article.all_topics' | t }}</option>
          {% for tag in blog.all_tags %}
          <option value="{{ blog.url }}/tagged/{{ tag | handleize }}" {% if current_tags contains tag %}selected{% endif %}>{{ tag }}</option>
          {% endfor %}
        </select>
        {% include 'icon-chevron-down' %}
      </div>
    </div>
    {% endif %}
    {% endcomment %}
  </header>
</div>


{% if section.settings.layout == 'grid' %}
<div class="page-width">
  <ul class="grid grid--uniform grid--blog">
    {% for article in blog.articles %}
    <li class="grid__item medium-up--one-third">
      <a href="{{ article.url }}" class="article__link">
        {% if article.image %}
        {% capture img_id %}ArticleImage-{{ article.image.id }}{% endcapture %}
        {% capture img_wrapper_id %}ArticleImageWrapper-{{ article.image.id }}{% endcapture %}
        {%- assign img_url = article.image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}

        {% include 'image-style', image: article.image, height: 345, wrapper_id: img_wrapper_id, img_id: img_id %}
        <div id="{{ img_wrapper_id }}" class="article__grid-image-wrapper js">
          <div class="article__grid-image-container" style="padding-top:{{ 1 | divided_by: article.image.aspect_ratio | times: 100 }}%;" data-image-loading-animation>
            <img id="{{ img_id }}"
                 class="article__grid-image lazyload"
                 data-src="{{ img_url }}"
                 data-widths="[180, 360, 540, 720, 900, 1080, 1296, 1512, 1728, 2048]"
                 data-aspectratio="{{ article.image.aspect_ratio }}"
                 data-sizes="auto"
                 alt="">
          </div>
        </div>
        <noscript>
          <div class="article__grid-image-wrapper">
            {{ article | img_url: '345x345', scale: 2 | img_tag: article.title, 'article__grid-image' }}
          </div>
        </noscript>
        {% endif %}

        <h2 class="article__title h3{% if article.image %} article__title--has-image{% endif %}">
          {{ article.title | escape }}
        </h2>
      </a>

      <div class="article__grid-meta{% if article.image %} article__grid-meta--has-image{% endif %}">
        {% if section.settings.blog_show_author %}
        <span class="article__author">{{ 'blogs.article.by_author' | t: author: article.author }}</span>
        {% endif %}

        {% if section.settings.blog_show_date %}
        <span class="article__date">
          {{ article.published_at | time_tag: format: 'date' }}
        </span>
        {% endif %}

        <div class="rte article__grid-excerpt">
          {% if article.excerpt.size > 0 %}
          {{ article.excerpt }}
          {% else %}
          {{ article.content | strip_html | truncate: 150 }}
          {% endif %}
        </div>

        {% if section.settings.article_tags != blank %}
        {% if article.tags.size > 0 %}
        <div class="article__tags rte">
          <ul class="list--inline" aria-label="{{ 'blogs.article.tags' | t }}">
            {% for tag in article.tags %}
            <li>
              <a href="{{ blog.url }}/tagged/{{ tag | handle }}" class="article__grid-tag">{{ tag }}</a>
            </li>
            {% endfor %}
          </ul>
        </div>
        {% endif %}
        {% endif %}

        <ul class="list--inline article__meta-buttons">
          <li>
            <a href="{{ article.url }}" class="btn btn--tertiary btn--small" aria-label="{{ 'blogs.article.read_more_title' | t: title: article.title }}">
              {{ 'blogs.article.read_more' | t }}
            </a>
          </li>

          {% if blog.comments_enabled? and article.comments_count > 0 %}
          <li>
            <a href="{{ article.url }}#comments" class="article__comment-count btn btn--tertiary btn--small">
              {{ 'blogs.comments.comments_with_count' | t: count: article.comments_count }}
            </a>
          </li>
          {% endif %}
        </ul>
      </div>
    </li>
    {% endfor %}
  </ul>
</div>
{% else %}
<ul class="blog-list-view">
  {% for article in blog.articles %}
  <li class="border-top">
    <div class="page-width">
      <div class="grid">
        <div class="grid__item medium-up--five-sixths medium-up--push-one-twelfth">
          <div class="article-listing">
            
            {% if article.image %}
            {% capture img_id %}ArticleImage-{{ article.image.id }}{% endcapture %}
            {% capture img_wrapper_id %}ArticleImageWrapper-{{ article.image.id }}{% endcapture %}
            {%- assign img_url = article.image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}

            {% include 'image-style', image: article.image, height: 600, wrapper_id: img_wrapper_id, img_id: img_id %}

            <div id="" class="article__list-image-wrapper js">
              <a href="{{ article.url }}" style="padding-top:{{ 1 | divided_by: article.image.aspect_ratio | times: 100 }}%;" class="article__list-image-container" data-image-loading-animation>
                <img id="blog_{{ img_id }}"
                     class="article__list-image lazyload"
                     data-src="{{ img_url }}"
                     data-widths="[180, 360, 540, 720, 905, 1090, 1296, 1512, 1728, 2048]"
                     data-aspectratio="{{ article.image.aspect_ratio }}"
                     data-sizes="auto"
                     alt="">
              </a>
            </div>

            <noscript>
              <p>
                <a href="{{ article.url }}">
                  {{ article | img_url: '455x300', scale: 2 | img_tag: article.title }}
                </a>
              </p>
            </noscript>
            {% endif %}
            <div class="blog_detail">
              <h2 class="article__title h3"><a href="{{ article.url }}">{{ article.title }}</a></h2>
              {% if section.settings.blog_show_author %}
              <span class="article__author">{{ 'blogs.article.by_author' | t: author: article.author }}</span>
              {% endif %}

              {% if section.settings.blog_show_date %}
              <span class="article__date">
                {{ article.published_at | time_tag: format: 'date' }}
              </span>
              {% endif %}

              {% comment %}
              <div class="rte">
                {% if article.excerpt.size > 0 %}
                {{ article.excerpt }}
                {% else %}
                {{ article.content | strip_html | truncate: 150 }}
                {% endif %}
              </div>
              {% endcomment %}

              {% if section.settings.article_tags != blank %}
              {% if article.tags.size > 0 %}
              <div class="article__tags article__tags--list rte">
                {{ 'blogs.article.posted_in' | t }}
                {% for tag in article.tags %}
                <a href="{{ blog.url }}/tagged/{{ tag | handle }}">{{ tag }}</a>{% unless forloop.last %}, {% endunless %}
                {% endfor %}
              </div>
              {% endif %}
              {% endif %}

              <ul class="list--inline article__meta-buttons">
                <li>
                  <a href="{{ article.url }}" class="btn btn--tertiary btn--small" aria-label="{{ 'blogs.article.read_more_title' | t: title: article.title }}">
                    {{ 'blogs.article.read_more' | t }}
                  </a>
                </li>

                {% if blog.comments_enabled? and article.comments_count > 0 %}
                <li>
                  <a href="{{ article.url }}#comments" class="article__comment-count btn btn--tertiary btn--small">
                    {{ 'blogs.comments.comments_with_count' | t: count: article.comments_count }}
                  </a>
                </li>
                {% endif %}

              </ul>
            </div>
          </div>
        </div>
      </div>
    </div>
  </li>
  {% endfor %}
</ul>
{% endif %}

{%- if paginate.pages > 1 -%}
  {% include 'pagination', paginate: paginate %}
{%- endif -%}

{% endpaginate %}



{% schema %}
{
  "name": {
    "cs": "Stránky blogu",
    "da": "Blogsider",
    "de": "Blogseiten",
    "en": "Blog pages",
    "es": "Páginas del blog",
    "fi": "Blogisivut",
    "fr": "Pages du blog",
    "it": "Pagine del blog",
    "ja": "ブログページ",
    "ko": "블로그 페이지",
    "nb": "Bloggsider",
    "nl": "Blogpagina's",
    "pl": "Strony blogu",
    "pt-BR": "Páginas do blog",
    "pt-PT": "Páginas do blogue",
    "sv": "Bloggsidor",
    "th": "หน้าบล็อก",
    "tr": "Blog sayfaları",
    "vi": "Trang blog",
    "zh-CN": "博客页面",
    "zh-TW": "部落格頁面"
  },
  "settings": [
    {
      "type": "select",
      "id": "layout",
      "label": {
        "cs": "Rozvržení",
        "da": "Layout",
        "de": "Layout",
        "en": "Layout",
        "es": "Diseño",
        "fi": "Asettelu",
        "fr": "Mise en page",
        "it": "Layout",
        "ja": "レイアウト",
        "ko": "레이아웃",
        "nb": "Oppsett",
        "nl": "Opmaak",
        "pl": "Układ",
        "pt-BR": "Layout",
        "pt-PT": "Esquema",
        "sv": "Layout",
        "th": "เลย์เอาต์",
        "tr": "Düzen",
        "vi": "Bố cục",
        "zh-CN": "布局",
        "zh-TW": "版面配置"
      },
      "default": "list",
      "options": [
        {
          "value": "grid",
          "label": {
            "cs": "Mřížka",
            "da": "Gitter",
            "de": "Raster",
            "en": "Grid",
            "es": "Cuadrícula",
            "fi": "Ruudukko",
            "fr": "Grille",
            "it": "Griglia",
            "ja": "グリッド",
            "ko": "그리드",
            "nb": "Rutenett",
            "nl": "Raster",
            "pl": "Siatka",
            "pt-BR": "Grade",
            "pt-PT": "Grelha",
            "sv": "Rutnät",
            "th": "กริด",
            "tr": "Izgara",
            "vi": "Lưới",
            "zh-CN": "网格",
            "zh-TW": "網格"
          }
        },
        {
          "value": "list",
          "label": {
            "cs": "Seznam",
            "da": "Liste",
            "de": "Liste",
            "en": "List",
            "es": "Lista",
            "fi": "Luettelo",
            "fr": "Liste",
            "it": "Elenco",
            "ja": "リスト",
            "ko": "목록",
            "nb": "Liste",
            "nl": "Lijst",
            "pl": "Lista",
            "pt-BR": "Lista",
            "pt-PT": "Lista",
            "sv": "Lista",
            "th": "รายการ",
            "tr": "Liste",
            "vi": "Danh sách",
            "zh-CN": "列表",
            "zh-TW": "清單"
          }
        }
      ]
    },
    {
      "type": "checkbox",
      "id": "blog_show_author",
      "label": {
        "cs": "Zobrazit autora",
        "da": "Vis forfatter",
        "de": "Autor anzeigen",
        "en": "Show author",
        "es": "Mostrar autor",
        "fi": "Näytä tekijä",
        "fr": "Afficher l'auteur",
        "it": "Mostra autore",
        "ja": "執筆者を表示する",
        "ko": "작성자 표시",
        "nb": "Vis forfatter",
        "nl": "Auteur weergeven",
        "pl": "Pokaż autora",
        "pt-BR": "Exibir autor",
        "pt-PT": "Mostrar autor",
        "sv": "Visa författare",
        "th": "แสดงผู้เขียน",
        "tr": "Yazarı göster",
        "vi": "Hiển thị tác giả",
        "zh-CN": "显示作者",
        "zh-TW": "顯示作者"
      },
      "default": true
    },
    {
      "type": "checkbox",
      "id": "blog_show_date",
      "label": {
        "cs": "Zobrazit datum",
        "da": "Vis dato",
        "de": "Datum anzeigen",
        "en": "Show date",
        "es": "Mostrar fecha",
        "fi": "Näytä päivämäärä",
        "fr": "Afficher la date",
        "it": "Mostra data",
        "ja": "日付を表示する",
        "ko": "날짜 표시",
        "nb": "Vis dato",
        "nl": "Datum weergeven",
        "pl": "Pokaż datę",
        "pt-BR": "Exibir data",
        "pt-PT": "Mostrar data",
        "sv": "Visa datum",
        "th": "แสดงวันที่",
        "tr": "Tarihi göster",
        "vi": "Hiển thị ngày",
        "zh-CN": "显示日期",
        "zh-TW": "顯示日期"
      },
      "default": true
    },
	{
	  "type": "checkbox",
	  "id": "article_tags",
	  "label": "Show article tags",
	  "default": false
	}
  ]
}
{% endschema %}
