Skip to content
Permalink
Browse files

Accomodating for INDEXES_STATIC.

  • Loading branch information...
felixfontein committed Dec 5, 2016
1 parent f78a4be commit 9727d85e575b88eeaf05df0e32696db3aafbd3a5
@@ -17,7 +17,7 @@
{{ front_index_header }}
{% endif %}
{% if page_links %}
{{ pagination.page_navigation(current_page, page_links, prevlink, nextlink) }}
{{ pagination.page_navigation(current_page, page_links, prevlink, nextlink, prev_next_links_reversed) }}
{% endif %}
<div class="postindex">
{% for post in posts %}
@@ -1,5 +1,5 @@
{# -*- coding: utf-8 -*- #}
{% macro page_navigation(current_page, page_links, prevlink, nextlink) %}
{% macro page_navigation(current_page, page_links, prevlink, nextlink, prev_next_links_reversed) %}
<div class="page-navigation">
{% for i, link in enumerate(page_links) %}
{% if abs(i - current_page) <= 3 or i == 0 or i == page_links|length - 1 %}
@@ -17,7 +17,7 @@
${front_index_header}
% endif
% if page_links:
${pagination.page_navigation(current_page, page_links, prevlink, nextlink)}
${pagination.page_navigation(current_page, page_links, prevlink, nextlink, prev_next_links_reversed)}
% endif
<div class="postindex">
% for post in posts:
@@ -1,5 +1,5 @@
## -*- coding: utf-8 -*-
<%def name="page_navigation(current_page, page_links, prevlink, nextlink)">
<%def name="page_navigation(current_page, page_links, prevlink, nextlink, prev_next_links_reversed)">
<div class="page-navigation">
% for i, link in enumerate(page_links):
% if abs(i - current_page) <= 3 or i == 0 or i == len(page_links) - 1:
@@ -1,19 +1,35 @@
{# -*- coding: utf-8 -*- #}
{% macro page_navigation(current_page, page_links, prevlink, nextlink) %}
{% macro page_navigation(current_page, page_links, prevlink, nextlink, prev_next_links_reversed) %}
<nav aria-label="Page navigation">
<ul class="pagination">
{% if prevlink %}
<li><a href="{{ prevlink }}" aria-label="{{ messages("Newer posts") }}"><span aria-hidden="true">&laquo;</span></a></li>
{% if prev_next_links_reversed %}
{% if nextlink %}
<li><a href="{{ nextlink }}" aria-label="{{ messages("Older posts") }}"><span aria-hidden="true">&laquo;</span></a></li>
{% else %}
<li class="disabled"><a href="#" aria-label="{{ messages("Older posts") }}"><span aria-hidden="true">&laquo;</span></a></li>
{% endif %}
{% else %}
<li class="disabled"><a href="#" aria-label="{{ messages("Newer posts") }}"><span aria-hidden="true">&laquo;</span></a></li>
{% if prevlink %}
<li><a href="{{ prevlink }}" aria-label="{{ messages("Newer posts") }}"><span aria-hidden="true">&laquo;</span></a></li>
{% else %}
<li class="disabled"><a href="#" aria-label="{{ messages("Newer posts") }}"><span aria-hidden="true">&laquo;</span></a></li>
{% endif %}
{% endif %}
{% for i, link in enumerate(page_links) %}
<li {{ ' class="active"' if i == current_page else '' }}><a href="{{ link }}">{{ i + 1 }}{{ ' <span class="sr-only">(current)</span>' if i == current_page else '' }}</a></li>
{% endfor %}
{% if nextlink %}
<li><a href="{{ nextlink }}" aria-label="{{ messages("Older posts") }}"><span aria-hidden="true">&raquo;</span></a></li>
{% if prev_next_links_reversed %}
{% if prevlink %}
<li><a href="{{ prevlink }}" aria-label="{{ messages("Newer posts") }}"><span aria-hidden="true">&raquo;</span></a></li>
{% else %}
<li class="disabled"><a href="#" aria-label="{{ messages("Newer posts") }}"><span aria-hidden="true">&raquo;</span></a></li>
{% endif %}
{% else %}
<li class="disabled"><a href="#" aria-label="{{ messages("Older posts") }}"><span aria-hidden="true">&raquo;</span></a></li>
{% if nextlink %}
<li><a href="{{ nextlink }}" aria-label="{{ messages("Older posts") }}"><span aria-hidden="true">&raquo;</span></a></li>
{% else %}
<li class="disabled"><a href="#" aria-label="{{ messages("Older posts") }}"><span aria-hidden="true">&raquo;</span></a></li>
{% endif %}
{% endif %}
</ul>
</nav>
@@ -1,19 +1,35 @@
## -*- coding: utf-8 -*-
<%def name="page_navigation(current_page, page_links, prevlink, nextlink)">
<%def name="page_navigation(current_page, page_links, prevlink, nextlink, prev_next_links_reversed)">
<nav aria-label="Page navigation">
<ul class="pagination">
% if prevlink:
<li><a href="${prevlink}" aria-label="${messages("Newer posts")}"><span aria-hidden="true">&laquo;</span></a></li>
% if prev_next_links_reversed:
% if nextlink:
<li><a href="${nextlink}" aria-label="${messages("Older posts")}"><span aria-hidden="true">&laquo;</span></a></li>
% else:
<li class="disabled"><a href="#" aria-label="${messages("Older posts")}"><span aria-hidden="true">&laquo;</span></a></li>
% endif
% else:
<li class="disabled"><a href="#" aria-label="${messages("Newer posts")}"><span aria-hidden="true">&laquo;</span></a></li>
% if prevlink:
<li><a href="${prevlink}" aria-label="${messages("Newer posts")}"><span aria-hidden="true">&laquo;</span></a></li>
% else:
<li class="disabled"><a href="#" aria-label="${messages("Newer posts")}"><span aria-hidden="true">&laquo;</span></a></li>
% endif
% endif
% for i, link in enumerate(page_links):
<li ${' class="active"' if i == current_page else ''}><a href="${link}">${i + 1}${' <span class="sr-only">(current)</span>' if i == current_page else ''}</a></li>
% endfor
% if nextlink:
<li><a href="${nextlink}" aria-label="${messages("Older posts")}"><span aria-hidden="true">&raquo;</span></a></li>
% if prev_next_links_reversed:
% if prevlink:
<li><a href="${prevlink}" aria-label="${messages("Newer posts")}"><span aria-hidden="true">&raquo;</span></a></li>
% else:
<li class="disabled"><a href="#" aria-label="${messages("Newer posts")}"><span aria-hidden="true">&raquo;</span></a></li>
% endif
% else:
<li class="disabled"><a href="#" aria-label="${messages("Older posts")}"><span aria-hidden="true">&raquo;</span></a></li>
% if nextlink:
<li><a href="${nextlink}" aria-label="${messages("Older posts")}"><span aria-hidden="true">&raquo;</span></a></li>
% else:
<li class="disabled"><a href="#" aria-label="${messages("Older posts")}"><span aria-hidden="true">&raquo;</span></a></li>
% endif
% endif
</ul>
</nav>
@@ -2432,6 +2432,7 @@ def generic_index_renderer(self, lang, posts, indexes_title, template_name, cont
if kw['show_index_page_navigation']:
context['page_links'] = page_links_context
context['current_page'] = ipages_i - 1
context['prev_next_links_reversed'] = kw['indexes_static']
context["permalink"] = page_links[i]
output_name = os.path.join(kw['output_folder'], page_path(i, ipages_i, num_pages, False))
task = self.generic_post_list_renderer(

0 comments on commit 9727d85

Please sign in to comment.
You can’t perform that action at this time.