* speed up via reduced slugify calls (only call when needed)
* fix __repr__ to not contain str, should call repr on name
* add test_urlwrappers and move URLWrappers tests there
* add new equality test
* cleanup header
additionally:
* Content is now decorated with python_2_unicode_compatible
instead of treating __str__ differently
* better formatting for test_article_metadata_key_lowercase
to actually output the conflict instead of a non descriptive
error
Since users frequently ask how to enable line numbers in
Markdown-formatted code blocks, adding instructions to the docs will
allow us to point users there.
Fixes#1773
Updates the template logic for when page navigation is included in the
generated HTML in the notmyidea theme, fixing:
* Issue #1068: useless pagination controls should not be displayed when a
single page is generated (i.e. "Page 1/1"). New logic prevents the
generation of these superfluous page navigation controls. Tests updated
accordingly.
* Issue #1572: when multiple pages are generated and the last page contains
only one item, the closing </ol> and </section> tags are not generated,
resulting in page breakage. We need to check if
articles_page.has_other_pages(); if it does, a list has been generated per
line 19 or 25 and the tags must be closed.
The `PageGenerator` was building hidden pages, but was not making them
available in the context. This makes it difficult for other plugins to
operate on hidden pages.
This patch updates `PageGenerator` to export the hidden pages it finds
in the context as `hidden_pages`.
It also updates the article generator to export `drafts`.
ARTICLE_ORDER_BY wasn't doing anything because the ArticlesGenerator
was sorting articles after ARTICLE_ORDER_BY was applied. This fixes
that by adding the ability to reverse metadata order by adding the
option prefix 'reversed-' to metadata and changing the default value
to 'reversed-date'.
Relevant documentation is also updated and moved into a more appropriate
place ('Ordering Content' instead of 'URL settings').
* remove content_object_init section from docs
* improve content_object_init test
The content_object_init signal used to set its class as sender and pass
the instance as additional arg in 6100773. Commit ed907b4 removed this
behaviour to bring it inline with other signals, on the basis that
you can test for the class of the object anyway.
We also had a test in place, checking this behaviour, but it was poorly
implemented, not actually checking if the function ever got called.
closes#1711
ref #1689
* set default settigns in settings.py to False for
- LOAD_CONTENT_CACHE
- CACHE_CONTENT
* remove AUTORELOAD_IGNORE_CACHE and add deprecation warning
* update settings.rst to reflect the new default values
* update test_cache to enable caching options
* break out cache into cache.py
* break out cache-tests into test_cache.py
* fix broken cache tests
* replace non existing assert calls with self.assertEqual
* fix path for page caching test (was invalid)
* cleanup test code
* restructure generate_context in Article and Path Generator
* destinguish between valid/invalid files correctly and cache accordingly
* use cPickle if available for increased performance
This requires a significant overhaul because we want to be able to have
IGNORE_FILES apply at every level of a recursively copied directory
(e.g. the theme static directory). Since I was overhauling it anyway
I changed it to use os.walk, which should be more efficient.
Idea borrowed from Docutils. This allows one to write author lists in
lastname,firstname format. The code change also means that readers with
fancy metadata that can natively represent lists (e.g. Docutils itself,
or MD-Yaml) don't have to merge 'em back together for process_metadata's
sake.
Adds exception type to the exception logging.
Removes the extra logging for autoreload in debug mode, since `raise`
will make it caught by the global `try/except` below and it'll be
logged there.
This replaces #1723 and also removes extra exception logging caused
in #1718.
This replaces all `http://` and `//:` links with `https:`. The protocol-
relative URL scheme is now deemed to be an anti-pattern. There are
security advantages to using HTTPS, and there are no significant
performance concerns.
In short, if the asset we need is available via HTTPS, then that asset
should always be loaded via HTTPS.
Fixes#1736