comparison piecrust/appconfigdefaults.py @ 979:45ad976712ec

tests: Big push to get the tests to pass again. - Lots of fixes everywhere in the code. - Try to handle debug logging in the multiprocessing worker pool when running in pytest. Not perfect, but usable for now. - Replace all `.md` test files with `.html` since now a auto-format extension always sets the format. - Replace `out` with `outfiles` in most places since now blog archives are added to the bake output and I don't want to add expected outputs for blog archives everywhere.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 29 Oct 2017 22:51:57 -0700
parents 504ddb370df8
children c8fb7b024faa
comparison
equal deleted inserted replaced
978:7e51d14097cb 979:45ad976712ec
187 page_prefix = '' 187 page_prefix = ''
188 fs_endpoint = 'posts' 188 fs_endpoint = 'posts'
189 data_endpoint = 'blog' 189 data_endpoint = 'blog'
190 item_name = 'post' 190 item_name = 'post'
191 tpl_func_prefix = 'pc' 191 tpl_func_prefix = 'pc'
192 year_archive_tpl = '_year.html'
192 193
193 if theme_site: 194 if theme_site:
194 # If this is a theme site, show posts from a `sample` directory 195 # If this is a theme site, show posts from a `sample` directory
195 # so it's clearer that those won't show up when the theme is 196 # so it's clearer that those won't show up when the theme is
196 # actually applied to a normal site. 197 # actually applied to a normal site.
206 default=('%spost' % blog_name)) 207 default=('%spost' % blog_name))
207 tpl_func_prefix = try_get_dict_values( 208 tpl_func_prefix = try_get_dict_values(
208 (site_values, '%s/func_prefix' % blog_name), 209 (site_values, '%s/func_prefix' % blog_name),
209 (values, '%s/func_prefix' % blog_name), 210 (values, '%s/func_prefix' % blog_name),
210 default=('pc%s' % blog_name)) 211 default=('pc%s' % blog_name))
212 year_archive_tpl = '%s_year.html,_year.html' % page_prefix
211 213
212 # Figure out the settings values for this blog, specifically. 214 # Figure out the settings values for this blog, specifically.
213 # The value could be set on the blog config itself, globally, or left at 215 # The value could be set on the blog config itself, globally, or left at
214 # its default. We already handle the "globally vs. default" with the 216 # its default. We already handle the "globally vs. default" with the
215 # `defs` map that we computed above. 217 # `defs` map that we computed above.
222 posts_per_page = blog_values['posts_per_page'] 224 posts_per_page = blog_values['posts_per_page']
223 date_format = blog_values['date_format'] 225 date_format = blog_values['date_format']
224 default_layout = blog_values['default_post_layout'] 226 default_layout = blog_values['default_post_layout']
225 post_url = '/' + url_prefix + blog_values['post_url'].lstrip('/') 227 post_url = '/' + url_prefix + blog_values['post_url'].lstrip('/')
226 year_url = '/' + url_prefix + blog_values['year_url'].lstrip('/') 228 year_url = '/' + url_prefix + blog_values['year_url'].lstrip('/')
227 year_archive_tpl = '%s_year.html' % page_prefix
228 229
229 cfg = collections.OrderedDict({ 230 cfg = collections.OrderedDict({
230 'site': collections.OrderedDict({ 231 'site': collections.OrderedDict({
231 'sources': collections.OrderedDict({ 232 'sources': collections.OrderedDict({
232 blog_name: collections.OrderedDict({ 233 blog_name: collections.OrderedDict({