|
64 | 64 | 'TIMEZONE': 'UTC',
|
65 | 65 | 'COMMENT_SYSTEM': 'disqus',
|
66 | 66 | 'COMMENT_SYSTEM_ID': 'nikolademo',
|
| 67 | + 'CATEGORY_ALLOW_HIERARCHIES': False, |
| 68 | + 'CATEGORY_OUTPUT_FLAT_HIERARCHY': False, |
67 | 69 | 'TRANSLATIONS_PATTERN': DEFAULT_TRANSLATIONS_PATTERN,
|
68 | 70 | 'INDEX_READ_MORE_LINK': DEFAULT_INDEX_READ_MORE_LINK,
|
69 | 71 | 'RSS_READ_MORE_LINK': DEFAULT_RSS_READ_MORE_LINK,
|
@@ -194,18 +196,18 @@ def get_msg(lang):
|
194 | 196 | return u'{{\n{0}\n}}'.format('\n\n'.join(pairs))
|
195 | 197 |
|
196 | 198 |
|
197 |
| -# In order to ensure proper escaping, all variables but the three |
198 |
| -# pre-formatted ones are handled by json.dumps(). |
| 199 | +# In order to ensure proper escaping, all variables but the pre-formatted ones |
| 200 | +# are handled by json.dumps(). |
199 | 201 | def prepare_config(config):
|
200 | 202 | """Parse sample config with JSON."""
|
201 | 203 | p = config.copy()
|
202 |
| - p.update(dict((k, json.dumps(v, ensure_ascii=False)) for k, v in p.items() |
203 |
| - if k not in ('POSTS', 'PAGES', 'COMPILERS', 'TRANSLATIONS', 'NAVIGATION_LINKS', '_SUPPORTED_LANGUAGES', '_SUPPORTED_COMMENT_SYSTEMS', 'INDEX_READ_MORE_LINK', 'RSS_READ_MORE_LINK', 'PRETTY_URLS'))) |
| 204 | + p.update({k: json.dumps(v, ensure_ascii=False) for k, v in p.items() |
| 205 | + if k not in ('POSTS', 'PAGES', 'COMPILERS', 'TRANSLATIONS', 'NAVIGATION_LINKS', '_SUPPORTED_LANGUAGES', '_SUPPORTED_COMMENT_SYSTEMS', 'INDEX_READ_MORE_LINK', 'RSS_READ_MORE_LINK')}) |
204 | 206 | # READ_MORE_LINKs require some special treatment.
|
205 | 207 | p['INDEX_READ_MORE_LINK'] = "'" + p['INDEX_READ_MORE_LINK'].replace("'", "\\'") + "'"
|
206 | 208 | p['RSS_READ_MORE_LINK'] = "'" + p['RSS_READ_MORE_LINK'].replace("'", "\\'") + "'"
|
207 |
| - # json would make that `true` instead of `True` |
208 |
| - p['PRETTY_URLS'] = str(p['PRETTY_URLS']) |
| 209 | + # fix booleans and None |
| 210 | + p.update({k: str(v) for k, v in config.items() if isinstance(v, bool) or v is None}) |
209 | 211 | return p
|
210 | 212 |
|
211 | 213 |
|
|
0 commit comments