comparison piecrust/sources/autoconfig.py @ 989:8adc27285d93

bake: Big pass on bake performance. - Reduce the amount of data passed between processes. - Make inter-process data simple objects to make it easier to test with alternatives to pickle. - Make sources have the basic requirement to be able to find a content item from an item spec (path). - Make Hoedown the default Markdown formatter.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 19 Nov 2017 14:29:17 -0800
parents 45ad976712ec
children f8572df0756e
comparison
equal deleted inserted replaced
988:f83ae0a5d793 989:8adc27285d93
90 elif len(values) == 0: 90 elif len(values) == 0:
91 values = None 91 values = None
92 92
93 return {self.setting_name: values} 93 return {self.setting_name: values}
94 94
95 def findContent(self, route_params): 95 def findContentFromRoute(self, route_params):
96 # Pages from this source are effectively flattened, so we need to 96 # Pages from this source are effectively flattened, so we need to
97 # find pages using a brute-force kinda way. 97 # find pages using a brute-force kinda way.
98 route_slug = route_params.get('slug', '') 98 route_slug = route_params.get('slug', '')
99 if not route_slug: 99 if not route_slug:
100 route_slug = '_index' 100 route_slug = '_index'
129 super().__init__(app, name, config) 129 super().__init__(app, name, config)
130 130
131 self.setting_name = config.get('setting_name', 'order') 131 self.setting_name = config.get('setting_name', 'order')
132 self.default_value = config.get('default_value', 0) 132 self.default_value = config.get('default_value', 0)
133 133
134 def findContent(self, route_params): 134 def findContentFromRoute(self, route_params):
135 uri_path = route_params.get('slug', '') 135 uri_path = route_params.get('slug', '')
136 if uri_path == '': 136 if uri_path == '':
137 uri_path = '_index' 137 uri_path = '_index'
138 138
139 path = self.fs_endpoint_path 139 path = self.fs_endpoint_path