Support ordering pages and articles when iterating in templates.
Order can be set to a metadata attribute or a sorting function.
Default to order by slug for articles and order by filename for pages.
Add test for PAGE_ORDER_BY
Merge remote-tracking branch 'remotes/malept/davidmarble-page-order-by' into davidmarble-page-order-by

Conflicts:
	docs/settings.rst
	pelican/generators.py
	pelican/tests/test_generators.py
Add missing methods
Address code review comments from PR getpelican/pelican#1348

The text about the sort-by-key function comes from:
https://docs.python.org/2/library/stdtypes.html#sequence-types-str-unicode-list-tuple-bytearray-buffer-xrange

Minor style cleanup as well.
Merge branch 'master' of https://github.com/getpelican/pelican into davidmarble-page-order-by
Addressed comments from @avaris in PR getpelican/pelican#1348
prettify github make commit message
update make github commit message
Add timezone to datetime objects. Refs #962.

Based on https://github.com/getpelican/pelican/pull/977, but it adds
timezone information before formatting.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
removed extra backtick in settings documentation

``SLUG_SUBSTITUTIONS` = ()`` becomes ``SLUG_SUBSTITUTIONS = ()``
Merge pull request #1392 from arty-name/patch-1

Remove extra backtick in settings documentation
Merge pull request #1372 from Railslide/make_github_commit_message

change make github commit message
Fixes wrongly generated relative urls for pagination.

When `RELATIVE_URLS` is `True` and the `PAGINATION_PATTERNS` adds folder to the path, the relative urls to these pages does not respect these additional folders.

Example:
	Settings:
			RELATIVE_URLS = True
			PAGINATION_PATTERNS = (
					(1, '{base_name}/', '{base_name}/index.html'),
					(2, '{base_name}/page/{number}/', '{base_name}/page/{number}/index.html'),)

	Theme:
			<link href="{{ SITEURL }}/theme/css/style.css" rel="stylesheet">

If you are on page 2 then "{{ SITEURL }}/theme/css/style.css" expands to "./theme/css/style.css" instead of "./../../theme/css/style.css".

Fix:
Simply compute the relative url from the paginated url instead of the not paginated one.
Reader name now accessible for articles and pages
Fixes #1395: extends pelican.utils.strftime with `-` prefix to strip leading zeros

Adds the ability to use `-` prefix with C89 format codes to strip any
leading zeros.
Merge pull request #1323 from DandyDev/access-reader-names

Reader name now accessible for articles and pages
Refactor logging handling

Old system was using manual string formatting for log messages.
This caused issues with common operations like exception logging
because often they need to be handled differently for Py2/Py3
compatibility. In order to unify the effort:

 - All logging is changed to `logging.level(msg, arg1, arg2)` style.
 - A `SafeLogger` is implemented to auto-decode exceptions properly
in the args (ref #1403).
 - Custom formatters were overriding useful logging functionality
like traceback outputing (ref #1402). They are refactored to be
more transparent. Traceback information is provided in `--debug`
mode for `read_file` errors in generators.
 - Formatters will now auto-format multiline log messages in order
to make them look related. Similarly, traceback will be formatted in
the same fashion.
 - `pelican.log.LimitFilter` was (ab)using logging message which
would result in awkward syntax for argumented logging style. This
functionality is moved to `extra` keyword argument.
 - Levels for errors that would result skipping a file (`read_file`)
changed from `warning` to `error` in order to make them stand out
among other logs.
 - Small consistency changes to log messages (i.e. changing all
to start with an uppercase letter) and quality-of-life improvements
(some log messages were dumping raw object information).
Debug print removal

The print either is a debug print that needs removing, or needs an additional description. The first is more likely.
Merge pull request #1415 from RR2DO2/patch-1

Debug print removal

the print() was a leftover from caching development.