Mercurial > piecrust2
changeset 486:aae241804096
themes: Don't fixup template directories, it's actually better as-is.
Prepending `theme/` is not too much trouble, and directories without that are
useful for handling possible user overrides.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 22 Jul 2015 20:00:14 -0700 |
parents | c40b7923c474 |
children | 61508ae67488 |
files | piecrust/app.py |
diffstat | 1 files changed, 2 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/piecrust/app.py Wed Jul 22 00:07:57 2015 -0700 +++ b/piecrust/app.py Wed Jul 22 20:00:14 2015 -0700 @@ -29,7 +29,7 @@ logger = logging.getLogger(__name__) -CACHE_VERSION = 20 +CACHE_VERSION = 21 class VariantNotFoundError(Exception): @@ -433,27 +433,7 @@ config_cache = self.cache.getCache('app') config = PieCrustConfiguration(paths, config_cache) if self.theme_dir: - # We'll need to patch the templates directories to be relative - # to the site's root, and not the theme root. - def _fixupThemeTemplatesDir(index, config): - if index != 0: - return - sitec = config.get('site') - if sitec is None: - return - tplc = sitec.get('templates_dirs') - if tplc is None: - return - if isinstance(tplc, str): - tplc = [tplc] - sitec['templates_dirs'] = list( - map( - lambda p: os.path.join(self.theme_dir, p), - tplc)) - - config.fixups.append(_fixupThemeTemplatesDir) - - # We'll also need to flag all page sources as coming from + # We'll need to flag all page sources as coming from # the theme. def _fixupThemeSources(index, config): if index != 0: