Override theme templates. Refs #1092

Updated Jinga2 loader so that paths specified in `EXTRA_TEMPLATES_PATHS`
are checked for a template before checking in the theme's `template/`
directory.  This allows a user to override any theme template file.
This commit is contained in:
Pedro H 2016-10-06 14:21:27 +08:00
commit ea93142dcf

View file

@ -52,9 +52,9 @@ class Generator(object):
# templates cache
self._templates = {}
self._templates_path = []
self._templates_path += self.settings['EXTRA_TEMPLATES_PATHS']
self._templates_path.append(os.path.expanduser(
os.path.join(self.theme, 'templates')))
self._templates_path += self.settings['EXTRA_TEMPLATES_PATHS']
theme_path = os.path.dirname(os.path.abspath(__file__))