Skip to content

Commit a9b3f75

Browse files
committedDec 23, 2016
Use archive navigation in all 3 necessary templates
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent 0e8b8ce commit a9b3f75

File tree

5 files changed

+11
-36
lines changed

5 files changed

+11
-36
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
## -*- coding: utf-8 -*-
2-
<%inherit file="base.tmpl"/>
32

4-
<%block name="content">
5-
<article class="listpage">
6-
<header>
7-
<h1>${title|h}</h1>
8-
</header>
3+
<%def name="archive_navigation()">
4+
%if 'archive_page' in pagekind:
95
%if has_archive_navigation:
106
<nav class="archivenav">
117
<ul class="pager">
@@ -21,17 +17,5 @@
2117
</ul>
2218
</nav>
2319
%endif
24-
%if items:
25-
<ul class="postlist">
26-
% for text, link, count in items:
27-
<li><a href="${link}">${text|h}</a>
28-
% if count:
29-
(${count})
30-
% endif
31-
% endfor
32-
</ul>
33-
%else:
34-
<p>${messages("Nothing found.")}</p>
35-
%endif
36-
</article>
37-
</%block>
20+
% endif
21+
</%def>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## -*- coding: utf-8 -*-
22
<%inherit file="index.tmpl"/>
3+
<%namespace name="archive_nav" file="archive_navigation_helper.tmpl" import="*"/>
34

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

1516
<%block name="content_header">
16-
%if has_archive_navigation:
17-
<nav class="archivenav">
18-
<ul class="pager">
19-
%if previous_archive:
20-
<li class="previous"><a href="${previous_archive}" rel="prev">${messages("Previous")}</a></li>
21-
%endif
22-
%if up_archive:
23-
<li class="up"><a href="${up_archive}" rel="up">${messages("Up")}</a></li>
24-
%endif
25-
%if next_archive:
26-
<li class="next"><a href="${next_archive}" rel="next">${messages("Next")}</a></li>
27-
%endif
28-
</ul>
29-
</nav>
30-
% endif
17+
${archive_nav.archive_navigation()}
3118
</%block>

‎nikola/data/themes/base/templates/list.tmpl

+2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
## -*- coding: utf-8 -*-
22
<%inherit file="base.tmpl"/>
3+
<%namespace name="archive_nav" file="archive_navigation_helper.tmpl" import="*"/>
34

45
<%block name="content">
56
<article class="listpage">
67
<header>
78
<h1>${title|h}</h1>
89
</header>
10+
${archive_nav.archive_navigation()}
911
%if items:
1012
<ul class="postlist">
1113
% for text, link, count in items:

‎nikola/data/themes/base/templates/list_post.tmpl

+2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
## -*- coding: utf-8 -*-
22
<%inherit file="base.tmpl"/>
3+
<%namespace name="archive_nav" file="archive_navigation_helper.tmpl" import="*"/>
34

45
<%block name="content">
56
<article class="listpage">
67
<header>
78
<h1>${title|h}</h1>
89
</header>
10+
${archive_nav.archive_navigation()}
911
%if posts:
1012
<ul class="postlist">
1113
% for post in posts:

‎nikola/plugins/task/archive.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Archive(Taxonomy):
4545
has_hierarchy = True
4646
include_posts_from_subhierarchies = True
4747
include_posts_into_hierarchy_root = True
48-
subcategories_list_template = "archive.tmpl"
48+
subcategories_list_template = "list.tmpl"
4949
generate_atom_feeds_for_post_lists = False
5050
template_for_classification_overview = None
5151
always_disable_rss = True

0 commit comments

Comments
 (0)
Please sign in to comment.