{% extends 'posts/base.html' %}
{% block title %} {{ title }} {% endblock %}
{% load paginate %}
{% load blog_tags %}
    {% block blog_content %}
<!-- breadcrumbs-schema -->
{% if tag or date or category %}
  <ol itemscope itemtype="http://schema.org/BreadcrumbList" class="breadcrumb">
    <li itemprop="itemListElement" itemscope
        itemtype="http://schema.org/ListItem">
      <a itemprop="item" href="/">
          <span itemprop="name">Home</span></a>
      <meta itemprop="position" content="1" />
    </li>
    {% if tag %}
      <li itemprop="itemListElement" itemscope
        itemtype="http://schema.org/ListItem">
      <a itemprop="item" href="/">
          <span itemprop="name">Tag</span></a>
      <meta itemprop="position" content="2" />
    </li>
    <li itemprop="itemListElement" itemscope
        itemtype="http://schema.org/ListItem">
      <a itemprop="item" href="/">
          <span itemprop="tag">{{ tag }}</span></a>
      <meta itemprop="position" content="3" />
    </li>
    {% endif %}
    {% if date %}
      <li itemprop="itemListElement" itemscope
        itemtype="http://schema.org/ListItem">
      <a itemprop="item" href="/">
          <span itemprop="name">Archive</span></a>
      <meta itemprop="position" content="2" />
    </li>
    <li itemprop="itemListElement" itemscope
        itemtype="http://schema.org/ListItem">
      <a itemprop="item" href="/">
          <span itemprop="month">{{ date|date:"F Y"}}</span></a>
      <meta itemprop="position" content="3" />
    </li>
    {% endif %}
    {% if category %}
    <li itemprop="itemListElement" itemscope
        itemtype="http://schema.org/ListItem">
      <a itemprop="item" href="/">
          <span itemprop="name">Category</span></a>
      <meta itemprop="position" content="2" />
    </li>
    <li itemprop="itemListElement" itemscope
        itemtype="http://schema.org/ListItem">
      <a itemprop="item" href="">
        <span itemprop="name"> {{ category }}</span></a>
      <meta itemprop="position" content="3" />
    </li>
    {% endif %}
  </ol>
{% endif %}
<!-- end -->
                    <div class="row col-sm-12 col-md-9 blog-container-left">
                        <div class="blogs">
                            <ul class="blog-list">
                                {% if blog_posts %}
                                    {% paginate 5 blog_posts %}
                                    {% for blog in blog_posts %}
                                        <li class="list-item" itemtype="http://schema.org/BlogPosting">
                                            <div class="blog-left">
                                                <h3 class="title" itemprop="name headline"><a href="{% url 'blog_post_view' blog_slug=blog.slug %}">{{ blog }}</a></h3>
                                            </div>
                                            <div class="desc">
                                                    <span>
                                                        <span itemprop="author" itemtype="http://schema.org/Person">{{ blog.user|title }} |</span>
                                                        <span itemprop="datePublished" itemtype="https://schema.org/datePublished"> {{ blog.updated_on|date:"d F Y" }}
                                                        </span>
                                                    </span>
                                                    <div class="content" itemprop="articleBody">
                                                    {{ blog.content|safe|truncatewords_html:50 }}
                                                    </div>
                                                    {% for tag in blog.tags.all %}
                                                        <span class="tags">
                                                            <a href="{% url 'selected_tag' tag_slug=tag.slug %}" ><i class="fa fa-tags"></i> {{ tag }}</a>
                                                        </span>
                                                    {% endfor %}
                                                <p class="continue-read"><a href="{% url 'blog_post_view' blog_slug=blog.slug %}">Continue reading ....</a></p>
                                            </div>
                                        </li>
                                        <hr />
                                    {% endfor %}
                                <!-- pagination -->
                                  <div class="pagination_wrap">
                                      {% show_pages %}
                                  </div>
                                <!--/ pagination -->
                                {% else %}
                                    <h2 align="center">There are no Blog-posts are here !</h2>
                                {% endif %}

                            </ul>
                        </div>
                    </div>


    {% endblock %}

    {% block js_script %}
        <script type="text/javascript">

            $('#home').addClass('active');

        </script>
    {% endblock %}
