add blog-page
This commit is contained in:
parent
27c921dba3
commit
62939f6b41
|
@ -1,9 +1,9 @@
|
|||
+++
|
||||
title = "List of blog posts"
|
||||
sort_by = "date"
|
||||
template = "index.html"
|
||||
template = "blog-list.html"
|
||||
page_template = "blog-page.html"
|
||||
|
||||
paginate_by = 4
|
||||
paginate_by = 9
|
||||
|
||||
+++
|
||||
|
|
34
templates/blog-list.html
Normal file
34
templates/blog-list.html
Normal file
|
@ -0,0 +1,34 @@
|
|||
{% extends "base.html" %}
|
||||
{% import 'macros/card.html' as macro_card -%}
|
||||
|
||||
{% block content %}
|
||||
<div class="columns is-multiline mt-6">
|
||||
{% for page in paginator.pages %}
|
||||
{{ macro_card::create_card(link=page.permalink, img=page.extra.image, title=page.title, subtitle="la génèse", abstract=page.summary, tags=page.taxonomies.tags, date=page.date) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<nav class="pagination is-rounded" role="navigation" aria-label="pagination">
|
||||
<ul class="pagination-list" style="justify-content: center;">
|
||||
{% if paginator.current_index > 2 %}
|
||||
<li><a href="{{ paginator.first }}" class="pagination-link" aria-label="Page 1">1</a></li>
|
||||
{% endif %}
|
||||
{% if paginator.current_index > 3 %}
|
||||
<li><span class="pagination-ellipsis">…</span></li>
|
||||
{% endif %}
|
||||
{% if paginator.previous %}
|
||||
<li><a class="pagination-link" href="{{ paginator.previous }}" aria-label="Page {{ paginator.current_index -1 }}">{{ paginator.current_index - 1 }}</a></li>
|
||||
{% endif %}
|
||||
<li><a class="pagination-link is-current" aria-label="Page {{ paginator.current_index }}" aria-current="page">{{ paginator.current_index }}</a></li>
|
||||
{% if paginator.next %}
|
||||
<li><a class="pagination-link" href="{{ paginator.next }}" aria-label="Page {{ paginator.current_index +1 }}">{{ paginator.current_index + 1 }}</a></li>
|
||||
{% endif %}
|
||||
{% if paginator.current_index + 2 < paginator.number_pagers %}
|
||||
<li><span class="pagination-ellipsis">…</span></li>
|
||||
{% endif %}
|
||||
{% if paginator.current_index < paginator.number_pagers - 1 %}
|
||||
<li><a href="{{ paginator.last }}" class="pagination-link" aria-label="Page {{ paginator.number_pagers }}">{{ paginator.number_pagers }}</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endblock content %}
|
Loading…
Reference in New Issue
Block a user