Skip to content
Browse files
Idea to avoid repeating ourselves so much in templates
  • Loading branch information
ralsina committed Sep 4, 2015
1 parent 096cd9f commit fefd6a1210472c65147a0068a5adee963d605b9f
Showing 3 changed files with 9 additions and 32 deletions.
@@ -4,6 +4,7 @@ New in master

* Allow inheriting templates with theme name (Issue #1814)
* Display post counts for archive links (Issue #2011)
* Document link/path handlers (Issue #2008)

@@ -1,5 +1,5 @@
## -*- coding: utf-8 -*-

<%inherit file="base/templates/base_helper.tmpl"/>
<%namespace name="notes" file="annotation_helper.tmpl" import="*" />
<%def name="html_headstart()">
<!DOCTYPE html>
@@ -155,33 +155,6 @@ lang="${lang}">

<%def name="html_feedlinks()">
%if rss_link:
%elif generate_rss:
%if len(translations) > 1:
%for language in sorted(translations):
<link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, language)}">
<link rel="alternate" type="application/rss+xml" title="RSS" href="${_link('rss', None)}">
%if generate_atom:
%if len(translations) > 1:
%for language in sorted(translations):
<link rel="alternate" type="application/atom+xml" title="Atom (${language})" href="${_link('index_atom', None, language)}">
<link rel="alternate" type="application/atom+xml" title="Atom" href="${_link('index_atom', None)}">
<%def name="html_feedlinks()"/>
<%def name="html_translations()"/>

<%def name="html_translations()">
%for langname in sorted(translations):
%if langname != lang:
<li><a href="${abs_link(_link("root", None, langname))}" rel="alternate" hreflang="${langname}">${messages("LANGUAGE", langname)}</a></li>
@@ -1006,8 +1006,11 @@ def _get_template_system(self):
self._template_system = pi.plugin_object
lookup_dirs = ['templates'] + [os.path.join(utils.get_theme_path(name), "templates")
for name in self.THEMES]
lookup_dirs = ['templates'] + \
[os.path.join(utils.get_theme_path(name), "templates") for name in self.THEMES] +\
list(set([os.path.dirname(utils.get_theme_path(name)) for name in self.THEMES]))


0 comments on commit fefd6a1

Please sign in to comment.