Mercurial > piecrust2
comparison piecrust/sources/fs.py @ 855:448710d84121
refactor: Get the taxonomy support back to a functional state.
There's now a taxonomy content source that wraps another normal content source
like a blog posts' source. It works in tandem with a taxonomy content pipeline
that will do the heavy lifting of figuring out what kind of terms exist and
need to be baked.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 06 Jun 2017 00:26:21 -0700 |
parents | 08e02c2a2a1a |
children | fddaf43424e2 |
comparison
equal
deleted
inserted
replaced
854:08e02c2a2a1a | 855:448710d84121 |
---|---|
31 """ | 31 """ |
32 def __init__(self, app, name, config): | 32 def __init__(self, app, name, config): |
33 super().__init__(app, name, config) | 33 super().__init__(app, name, config) |
34 self.fs_endpoint = config.get('fs_endpoint', name) | 34 self.fs_endpoint = config.get('fs_endpoint', name) |
35 self.fs_endpoint_path = os.path.join(self.root_dir, self.fs_endpoint) | 35 self.fs_endpoint_path = os.path.join(self.root_dir, self.fs_endpoint) |
36 | |
37 @property | |
38 def root_dir(self): | |
39 if self.is_theme_source: | |
40 return self.app.theme_dir | |
41 return self.app.root_dir | |
36 | 42 |
37 def _checkFSEndpoint(self): | 43 def _checkFSEndpoint(self): |
38 if not os.path.isdir(self.fs_endpoint_path): | 44 if not os.path.isdir(self.fs_endpoint_path): |
39 if self.config.get('ignore_missing_dir'): | 45 if self.config.get('ignore_missing_dir'): |
40 return False | 46 return False |