Mercurial > piecrust2
comparison piecrust/sources/autoconfig.py @ 853:f070a4fc033c
core: Continue PieCrust3 refactor, simplify pages.
The asset pipeline is still the only function pipeline at this point.
* No more `QualifiedPage`, and several other pieces of code deleted.
* Data providers are simpler and more focused. For instance, the page iterator
doesn't try to support other types of items.
* Route parameters are proper known source metadata to remove the confusion
between the two.
* Make the baker and pipeline more correctly manage records and record
histories.
* Add support for record collapsing and deleting stale outputs in the asset
pipeline.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 21 May 2017 00:06:59 -0700 |
parents | 4850f8c21b6e |
children | 45ad976712ec |
comparison
equal
deleted
inserted
replaced
852:4850f8c21b6e | 853:f070a4fc033c |
---|---|
13 class AutoConfigContentSourceBase(DefaultContentSource): | 13 class AutoConfigContentSourceBase(DefaultContentSource): |
14 """ Base class for content sources that automatically apply configuration | 14 """ Base class for content sources that automatically apply configuration |
15 settings to their generated pages based on those pages' paths. | 15 settings to their generated pages based on those pages' paths. |
16 """ | 16 """ |
17 def __init__(self, app, name, config): | 17 def __init__(self, app, name, config): |
18 DefaultContentSource.__init__(app, name, config) | 18 super().__init__(app, name, config) |
19 | |
20 config.setdefault('data_type', 'page_iterator') | |
19 | 21 |
20 self.capture_mode = config.get('capture_mode', 'path') | 22 self.capture_mode = config.get('capture_mode', 'path') |
21 if self.capture_mode not in ['path', 'dirname', 'filename']: | 23 if self.capture_mode not in ['path', 'dirname', 'filename']: |
22 raise ConfigurationError("Capture mode in source '%s' must be " | 24 raise ConfigurationError("Capture mode in source '%s' must be " |
23 "one of: path, dirname, filename" % | 25 "one of: path, dirname, filename" % |