Add a --setting-overrides KEY=VAL command line option to override
default settings or those defined in settings files. This adds
flexibility in running Pelican and helps reduce sprawl of settings
files. Cast int and str setting overrides to their respective types.
Support other setting types by treating them as JSON. Fall back to JSON
when an override typecast errors. This should make it possible to set
int values to None, resp. to JSON 'none'
This commit removes Six as a dependency for Pelican, replacing the
relevant aliases with the proper Python 3 imports. It also removes
references to Python 2 logic that did not require Six.
3a0add4b6e caused existing configs to fall
back to defaults. But since we know exactly how to fix the user config
so that the behavior doesn't change, we should do so, while still
warning that use of %s is deprecated.
Also fixes a bug where we tried to look for %s in None.
At the moment aborts with the following:
File "/usr/lib/python3.7/site-packages/pelican/settings.py", line 327, in handle_deprecated_settings
if t not in settings['PAGINATED_TEMPLATES']:
KeyError: 'PAGINATED_TEMPLATES'
Allow for overriding individual templates from the theme by configuring
the Jinja2 `Environment` loader to search for templates in the
`THEME_TEMPLATES_OVERRIDES` path before the theme's `templates/`
directory.
Added tests to ensure that:
- THEME and deprecated *_DIR settings result in the expected configurations
- Post headers are formatted correctly in both Markdown and reStructuredText
- Files specified in IGNORE_FILES setting are properly ignored
- Generator.get_files()'s `paths` argument is backwards-compatible with strings
* Fix {filename} links on Windows.
Otherwise '{filename}/foo/bar.jpg' doesn't work
* Clean up relative Posix path handling in contents.
* Use Posix paths in readers
* Environment for Popen must be strs, not unicodes.
* Ignore Git CRLF warnings.
* Replace CRLFs with LFs in inputs on Windows.
* Fix importer tests
* Fix test_contents
* Fix one last backslash in paginated output
* Skip the remaining failing locale tests on Windows.
* Document the use of forward slashes on Windows.
* Add some Fabric and ghp-import notes
The locale is a global state, and it was not properly reset to
whatever it was before the unitttest possibly changed it.
This is now fixed.
Not restoring the locale led to weird issues: depending on
the order chosen by "python -m unittest discover" to run
the unit tests, some tests would apparently randomly fail
due to the locale not being what was expected.
For example, test_period_in_timeperiod_archive would
call mock('posts/1970/ 1月/index.html',...) instead of
expected mock('posts/1970/Jan/index.html',...) and fail.
This dictionary is accessed by plugins (like `summary`) which add new
settings, so it should be public (i.e. no prefixed underscore).
The changed name length would have led to a re-indenting of the
default contents anyway, so I shifted them all to four spaces.