{% extends "base_blog_section.html" %}

{% block title %}{{ category|e }} | {{ M_BLOG_NAME|e }}{% endblock %}

{% block meta %}
  {% if category.page and category.page.description %}
  <meta name="description" content="{{ category.page.description|dehyphenate|striptags|e }}" />
  {% endif %}
{% endblock %}

{% block social_title_url_image %}
  <meta property="og:title" content="{% if category.page and category.page.title %}{{ category.page.title }}{% else %}{{ category|e }}{% endif %}" />
  <meta name="twitter:title" content="{% if category.page and category.page.title %}{{ category.page.title }}{% else %}{{ category|e }}{% endif %}" />
  <meta property="og:url" content="{{ category.url|format_siteurl|e }}" />
  {% if category.page and category.page.summary %}
  <meta property="og:description" content="{{ category.page.summary|dehyphenate|striptags|e }}" />
  <meta name="twitter:description" content="{{ category.page.summary|dehyphenate|striptags|e }}" />
  {% endif %}
  {% if category.page and category.page.image %}
  <meta property="og:image" content="{{ category.page.image|expand_link(category.page)|e }}" />
  <meta name="twitter:image" content="{{ category.page.image|expand_link(category.page)|e }}" />
  {% elif M_SOCIAL_IMAGE %}
  <meta property="og:image" content="{{ M_SOCIAL_IMAGE|format_siteurl|e }}" />
  <meta name="twitter:image" content="{{ M_SOCIAL_IMAGE|format_siteurl|e }}" />
  {% endif %}
{% endblock %}

{% block content_title %}
      <div class="m-info m-note">
        Showing only posts in <em>{{ category|e }}</em>. <a href="{{ M_BLOG_URL|format_siteurl|e }}">Show all posts.</a>
      </div>
      {% if category.page and category.page.content and articles_page.number == 1 %}
      <div class="m-block m-warning{% if category.page.image %} m-badge{% endif %}">
        {% if category.page.image %}
        <img src="{{ category.page.image|expand_link(category.page)|e }}" alt="{{ category|e }}" />
        {% endif %}
        <h3>{% if category.page.title %}{{ category.page.title }}{% else %}{{ category|e }}{% endif %}</h3>
        {{ category.page.content|rtrim|indent(8) }}
      </div>
      {% endif %}
{% endblock %}
