Mercurial > piecrust2
comparison piecrust/sources/posts.py @ 36:485682a6de50
New site layout support.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 20 Aug 2014 23:16:51 -0700 |
parents | 617191dec18e |
children | a46354306738 |
comparison
equal
deleted
inserted
replaced
35:e4c345dcf33c | 36:485682a6de50 |
---|---|
2 import os.path | 2 import os.path |
3 import re | 3 import re |
4 import glob | 4 import glob |
5 import logging | 5 import logging |
6 import datetime | 6 import datetime |
7 from piecrust import CONTENT_DIR | |
8 from piecrust.sources.base import (PageSource, IPreparingSource, | 7 from piecrust.sources.base import (PageSource, IPreparingSource, |
9 SimplePaginationSourceMixin, | 8 SimplePaginationSourceMixin, |
10 PageNotFoundError, InvalidFileSystemEndpointError, | 9 PageNotFoundError, InvalidFileSystemEndpointError, |
11 PageFactory, MODE_CREATING, MODE_PARSING) | 10 PageFactory, MODE_CREATING, MODE_PARSING) |
12 | 11 |
18 PATH_FORMAT = None | 17 PATH_FORMAT = None |
19 | 18 |
20 def __init__(self, app, name, config): | 19 def __init__(self, app, name, config): |
21 super(PostsSource, self).__init__(app, name, config) | 20 super(PostsSource, self).__init__(app, name, config) |
22 self.fs_endpoint = config.get('fs_endpoint', name) | 21 self.fs_endpoint = config.get('fs_endpoint', name) |
23 self.fs_endpoint_path = os.path.join(self.root_dir, CONTENT_DIR, self.fs_endpoint) | 22 self.fs_endpoint_path = os.path.join(self.root_dir, self.fs_endpoint) |
24 self.supported_extensions = list(app.config.get('site/auto_formats').keys()) | 23 self.supported_extensions = list(app.config.get('site/auto_formats').keys()) |
25 self.default_auto_format = app.config.get('site/default_auto_format') | 24 self.default_auto_format = app.config.get('site/default_auto_format') |
26 | 25 |
27 @property | 26 @property |
28 def path_format(self): | 27 def path_format(self): |