{% extends "base.html" %}
{% block content %}
    <article class="h-entry">
	<div> 
	    {% if heading %}<h1 class="p-name">{{heading}}</h1>{% endif %}
	</div> 
	<div class='e-content'>
	    <div class="row">
		<h3> Posts/Noticias mas recientes </h3>

		{% for post in contexto['lista_posts_recientes'] %}
		    <div id="noticia">

			<span class="titulo_noticia">
			    <a href="/posts/{{ post[0] }}">
				{{ post[0]|n_heading }} 
			    </a> 
			</span>
			<small>- modificado: {{ post[1] }} </small>
			<p>
			    {{ post[2]|safe }} ... 
			    (<a href="/posts/{{ post[0] }}">
			    ver más
			    </a>) 
			    <div>
				{% for cat in post[3] %}
				    <span class="categorias">
					<a href="/posts/categoria/{{ cat }}">
					    #{{ cat }}
					</a> &nbsp;&nbsp;
				    </span>
				{% endfor %}
			    </div>
			</p>

		    </div>
		{% endfor %}
	    </div>

	    {{contents}}

	    Ir a Página: 
	    {% for i in range((contexto['total_posts']//11) + 1 ) %}
		<span class="categorias"> 
		    {% if i == contexto['pagina_actual'] %}
			<a href="#">
			    <span style="border-style: dotted; border-right-width: 0px;">
				{{ i }}
			    </span>
			</a>
		    {% else %}
			<a href="/{{ i }}">
			    {{ i }}
			</a>
		    {% endif %}


		</span> &nbsp;&nbsp;
	    {% endfor %}

	</div>
    </article>
{% endblock %}
