{% extends "base.html" %}
{% block content_title %}{% endblock %}
{% block ogtitle %}{{ SITENAME }}{% endblock %}
{% block ogurl %}{{ SITEURL }}{%endblock%}
{% block canonicalurl %}{{ SITEURL }}{%endblock%}

{% block content %}
<div class="content-grid">
    {% if articles %}
        {% for article in articles_page.object_list %}
            {% if loop.length > 0 %}

                {% if loop.first %}
                {% endif %}

                    <div class="content-grid-info">
                        {% if article.image or article.thumb %}
                            <img src="{{ article.thumb|default(article.image) }}" alt="{{ article.title|striptags }}"/>
                        {% endif %}
                        <div class="post-info">
                            {% include 'article_infos.html' %}
                            <div>{{ article.summary }}</div>
                            <a href="{{ SITEURL }}/{{ article.url }}"><span></span>{{ READMORE_TEXT|default('read more...') }}</a>
                        </div>
                    </div>

                {% if loop.last %}
                    {% include 'pagination.html' %}
                {% endif %}

            {% endif %}
        {% endfor %}
    {% else %}
    <section  >
    <h2>Pages</h2>
        {% for page in PAGES %}
            <li><a href="{{ SITEURL }}/{{ page.url }}">{{ page.title }}</a></li>
        {% endfor %}
    </section>
    {% endif %}
</div>
{% endblock content %}

{% block sidebar %}

    <div class="recent">
        <h3>{{ CONTENT_TEXT|default('Content') }}</h3>
        <ul class="fa-ul">
            <li><a href="{{ SITEURL }}/{{ CATEGORIES_SAVE_AS|default('categories.html') }}"><i class="fa-li fa fa-tags"></i> {{ CATEGORIES_TEXT|default('Categories') }}</a></li>
            <li><a href="{{ SITEURL }}/{{ ARCHIVES_SAVE_AS|default('archives.html') }}"><i class="fa-li fa fa-calendar"></i> {{ ARCHIVES_TEXT|default('Archives') }}</a></li>
            <li><a href="{{ SITEURL }}/{{ TAGS_SAVE_AS|default('tags.html') }}"><i class="fa-li fa fa-tag"></i> {{ TAGS_TEXT|default('Tags') }}</a></li>

            {% if TAG_FEED_ATOM and tag is defined %}
                <li><a href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM|format(tag.slug) }}"><i class="fa-li fa fa-rss"></i> {{ ATOM_FEED_TEXT|default('Feed Atom') }}</a></li>
            {% elif CATEGORY_FEED_ATOM and category is defined %}
                <li><a href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM|format(category.slug) }}"><i class="fa-li fa fa-rss"></i> {{ ATOM_FEED_TEXT|default('Feed Atom') }}</a></li>
            {% elif FEED_ALL_ATOM %}
                <li><a href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}"><i class="fa-li fa fa-rss"></i> {{ ATOM_FEED_TEXT|default('Feed Atom') }}</a></li>
            {% endif %}

            {% if TAG_FEED_RSS and tag is defined %}
                <li><a href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(tag.slug) }}"><i class="fa-li fa fa-rss"></i> {{ RSS_FEED_TEXT|default('Feed RSS') }}</a></li>
            {% elif CATEGORY_FEED_RSS and category is defined %}
                <li><a href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS|format(category.slug) }}"><i class="fa-li fa fa-rss"></i> {{ RSS_FEED_TEXT|default('Feed RSS') }}</a></li>
            {% elif FEED_ALL_RSS %}
                <li><a href="{{ FEED_DOMAIN }}/{{ FEED_ALL_RSS }}"><i class="fa-li fa fa-rss"></i> {{ RSS_FEED_TEXT|default('Feed RSS') }}</a></li>
            {% endif %}
        </ul>
    </div>

    {% if LINKS %}
        <div class="side-links">
            <h3>{{ LINKS_TEXT|default('Links') }}</h3>
            <ul class="fa-ul">
                {% for name, link in LINKS %}
                    <li><a href="{{ link }}"><i class="fa-li fa fa-external-link"></i> {{ name }}</a></li>
                {% endfor %}
            </ul>
        </div>
    {% endif %}

    {% if SOCIAL %}
        <div class="side-links">
            <h3>{{ SOCIALLINKS_TEXT|default('Social links') }}</h3>
            <ul class="fa-ul">
                {% for name, link in SOCIAL %}
                    <li><a href="{{ link }}">{{ name }}</a></li>
                {% endfor %}
            </ul>
        </div>
    {% endif %}

    {% if TAG_CLOUD_STEPS %}
        <div class="categories">
            <h3>{{ TAGS_TEXT|default('Tags') }}</h3>
            <ul id="cloud">
                {% for tag in tag_cloud %}
                    <li class="tag-{{ tag.1 }}"><a href="{{ SITEURL }}/{{ tag.0.url }}">{{ tag.0 }}</a></li>
                {% endfor %}
            </ul>
         </div>
    {% endif %}

{% endblock %}
