# HG changeset patch # User Ludovic Chabant # Date 1437620414 25200 # Node ID aae241804096d748c8819d100a5612e7d79a0eb6 # Parent c40b7923c474ae3bca4532d2266988e6d58143a1 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. diff -r c40b7923c474 -r aae241804096 piecrust/app.py --- 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: