Skip to content

Commit

Permalink
Use archive navigation in all 3 necessary templates
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Dec 23, 2016
1 parent 0e8b8ce commit a9b3f75
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 36 deletions.
@@ -1,11 +1,7 @@
## -*- coding: utf-8 -*-
<%inherit file="base.tmpl"/>

<%block name="content">
<article class="listpage">
<header>
<h1>${title|h}</h1>
</header>
<%def name="archive_navigation()">
%if 'archive_page' in pagekind:
%if has_archive_navigation:
<nav class="archivenav">
<ul class="pager">
Expand All @@ -21,17 +17,5 @@
</ul>
</nav>
%endif
%if items:
<ul class="postlist">
% for text, link, count in items:
<li><a href="${link}">${text|h}</a>
% if count:
(${count})
% endif
% endfor
</ul>
%else:
<p>${messages("Nothing found.")}</p>
%endif
</article>
</%block>
% endif
</%def>
17 changes: 2 additions & 15 deletions nikola/data/themes/base/templates/archiveindex.tmpl
@@ -1,5 +1,6 @@
## -*- coding: utf-8 -*-
<%inherit file="index.tmpl"/>
<%namespace name="archive_nav" file="archive_navigation_helper.tmpl" import="*"/>

<%block name="extra_head">
${parent.extra_head()}
Expand All @@ -13,19 +14,5 @@
</%block>

<%block name="content_header">
%if has_archive_navigation:
<nav class="archivenav">
<ul class="pager">
%if previous_archive:
<li class="previous"><a href="${previous_archive}" rel="prev">${messages("Previous")}</a></li>
%endif
%if up_archive:
<li class="up"><a href="${up_archive}" rel="up">${messages("Up")}</a></li>
%endif
%if next_archive:
<li class="next"><a href="${next_archive}" rel="next">${messages("Next")}</a></li>
%endif
</ul>
</nav>
% endif
${archive_nav.archive_navigation()}
</%block>
2 changes: 2 additions & 0 deletions nikola/data/themes/base/templates/list.tmpl
@@ -1,11 +1,13 @@
## -*- coding: utf-8 -*-
<%inherit file="base.tmpl"/>
<%namespace name="archive_nav" file="archive_navigation_helper.tmpl" import="*"/>

<%block name="content">
<article class="listpage">
<header>
<h1>${title|h}</h1>
</header>
${archive_nav.archive_navigation()}
%if items:
<ul class="postlist">
% for text, link, count in items:
Expand Down
2 changes: 2 additions & 0 deletions nikola/data/themes/base/templates/list_post.tmpl
@@ -1,11 +1,13 @@
## -*- coding: utf-8 -*-
<%inherit file="base.tmpl"/>
<%namespace name="archive_nav" file="archive_navigation_helper.tmpl" import="*"/>

<%block name="content">
<article class="listpage">
<header>
<h1>${title|h}</h1>
</header>
${archive_nav.archive_navigation()}
%if posts:
<ul class="postlist">
% for post in posts:
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/archive.py
Expand Up @@ -45,7 +45,7 @@ class Archive(Taxonomy):
has_hierarchy = True
include_posts_from_subhierarchies = True
include_posts_into_hierarchy_root = True
subcategories_list_template = "archive.tmpl"
subcategories_list_template = "list.tmpl"
generate_atom_feeds_for_post_lists = False
template_for_classification_overview = None
always_disable_rss = True
Expand Down

0 comments on commit a9b3f75

Please sign in to comment.