Commit graph

3,314 commits

Author SHA1 Message Date
Justin Mayer
d43b786b30 Modernize code base to Python 3+ syntax
Replaces syntax that was relevant in earlier Python versions but that
now has modernized equivalents.
2020-04-27 09:45:31 +02:00
Justin Mayer
2cd1d44576 Relax hard/enforced line length to 88 characters 2020-04-27 09:45:30 +02:00
Justin Mayer
1ac4abcb67 Add Windows support to Invoke tasks 2020-04-24 15:21:05 +02:00
MinchinWeb
13e138aacd Add dev dependencies expected by tasks.py
Black requires at least Python 3.6
2020-04-24 14:48:34 +02:00
Justin Mayer
19e0f28c64
Merge pull request #2735 from avaris/redundant-tests
Remove duplicate tests in test_contents
2020-04-22 15:57:55 +02:00
Deniz Turgut
82fcfbcbfc Remove duplicate tests in test_contents
TestArticle was a subclass of TestPage and therefore included all
the tests TestPage already had. Effectively tests from TestPage
were run twice. This splits the common parts of TestPage to a
base class called TestBase and TestPage/TestArticle will both
inherit from it.
2020-04-21 23:45:55 +03:00
Justin Mayer
021ef45f75 Tidy SLUGIFY_* settings documentation 2020-04-21 05:36:28 +02:00
Justin Mayer
7e24886190
Merge pull request #2731 from avaris/unicode-slugify
Add support for Unicode slugs
2020-04-21 05:31:51 +02:00
Deniz Turgut
bd699d34e8 Expose preserve_case option from slugify 2020-04-21 00:26:00 +03:00
Justin Mayer
3031ca64c8 Fix Python 2/3 cache pickle format incompatibility 2020-04-20 11:40:51 +02:00
Justin Mayer
4a7cff7688 Fix anchor link to TIMEZONE settings documentation 2020-04-20 11:32:02 +02:00
Justin Mayer
3b5cdef7f9 Update dev docs to reflect Poetry behavior change
Otherwise, `poetry install` replaces the editable installation with the
current PyPI version.
2020-04-20 09:00:38 +02:00
Deniz Turgut
97fe235e60 Expose use_unicode setting of slugify in settings and use it 2020-04-19 20:21:00 +03:00
Deniz Turgut
03d9c38871 Rewrite pelican.utils.slugify to use unicode and add tests
Adds a use_unicode kwarg to slugify to keep unicode
characters as is (no ASCII-fying) and add tests for
it. Also reworks how slugification logic.

slugify started with the Django method for slugiying:
 - Normalize to compatibility decomposed from (NFKD)
 - Encode and decode with 'ascii'

This works fine if the decomposed form contains ASCII
characters (i.e. ç can be changed in to c+CEDILLA and
ASCII would keep c only), but fails when decomposition
doesn't result in ASCII characters (i.e. Chinese). To
solve that 'unidecode' was added, which works fine for
both cases. However, old method is now redundant but
was kept. This commit removes the old method and
adjusts logic slightly.

Now slugify will normalize all text with composition
mode (NFKC) to unify format for regex substitutions.
And then if use_unicode is False, uses unidecode to
convert it to ASCII.
2020-04-19 20:10:46 +03:00
Justin Mayer
075ca53bd2
Merge pull request #2593 from sharmaeklavya2/relative-static-paths
Use relative paths only in StaticGenerator
2020-04-18 18:58:46 +02:00
Justin Mayer
59462ad415
Merge pull request #2730 from avaris/namespace-redux
Fix legacy plugin loading
2020-04-17 20:21:25 +02:00
Deniz Turgut
46e1ec4f99 Fix legacy plugin loading 2020-04-17 21:15:25 +03:00
fancsali
f610801ee8
Add Typogrify/SmartyPants dashes config parameter (#2615) 2020-04-16 13:32:19 +02:00
Justin Mayer
cb3bb4ad69
Merge pull request #2727 from avaris/cleanup-after-tests
Reset global state set by tests in test_pelican
2020-04-16 10:17:54 +02:00
Deniz Turgut
d13108b03a Reset global state set by tests in test_pelican
Calling read_settings to clear the options put into
pelican.settings.PYGMENTS_RST_OPTIONS in tearDown so
that tests that are run after are not affected
2020-04-16 11:11:24 +03:00
Justin Mayer
e18c9d2c60 Remove Piwik from theme and settings docs
Name has been changed, and rather than fix it, it makes more sense to
deprecate analytics in Pelican core and relegate them to plugins/themes.
2020-04-16 08:26:09 +02:00
Justin Mayer
fc031174bb Flake8 fix 2020-04-16 08:10:30 +02:00
Justin Mayer
86ff02541f Fix building asciidoc headers in importer & add docs 2020-04-16 08:01:10 +02:00
Tim Janik
5365a1cdb3 PELICAN: pelican_import.py: add support for pelican-import -m asciidoc
Signed-off-by: Tim Janik <timj@gnu.org>
2020-04-16 07:48:04 +02:00
Justin Mayer
adf12505ab
Merge pull request #2724 from getpelican/theme-metadata
Put article summary in notmyidea "description" HTML metadata tag
2020-04-16 07:03:57 +02:00
Justin Mayer
592517dea9
Merge pull request #2725 from getpelican/slugify-preserve-case
Preserve category case in importer
2020-04-15 21:43:15 +02:00
Justin Mayer
8ba00dd9f1 Preserve category case in importer
Adds a `preserve_case` parameter to the `slugify()` function and uses it
to preserve capital letters in category names when using the Pelican
importer.
2020-04-15 20:42:21 +02:00
Justin Mayer
79095f7bd3
Merge pull request #2723 from getpelican/fix-delete-output-logic
Fix output directory deletion logic
2020-04-15 20:01:51 +02:00
Justin Mayer
540c06b2b8 Update test output with "description" metadata tag 2020-04-15 16:58:03 +02:00
Justin Mayer
d536cd2239 Put summary in notmyidea "description" HTML metadata 2020-04-15 16:54:17 +02:00
Justin Mayer
9d10abaed4 Fix output directory deletion logic
The intention was to prevent accidental source content data loss by
skipping output directory deletion if the output directory is a parent
of the source content directory. But the previous implementation did so
by checking path *strings*, resulting in scenarios where the following
settings would erroneously skip deletion of the output directory:

PATH = "/repo/docs-src/content"
OUTPUT_PATH = "/repo/docs"

The output directory should have been deleted but wasn't because the
PATH string contains "/repo/docs". This change eschews string comparison
and instead compares actual paths to ensure that the output path is not
a parent of the source content directory.
2020-04-15 15:19:41 +02:00
Cropse
7e52b61934
Enhance JINJA_FILTERS setting docs (#2126) 2020-04-15 10:42:21 +02:00
David Zaslavsky
9eb259af82
Wrong path for attached static content urls (#2158)
* Document _URL/_SAVE_AS path matching req. Fix #2158

This commit addresses the fact that some URLs (primarily {attach}) are based
on the *_SAVE_AS path instead of the *_URL path. It updates the documentation
to point out that the paths of corresponding _URL and _SAVE_AS settings should
match, and that the OUTPUT directory should correspond to the web server's
document root, in order to avoid producing these incorrect URLs.

* Clarify {attach} and *_URL / *_SAVE_AS caveat

Co-authored-by: Justin Mayer <entroP@gmail.com>
2020-04-15 10:35:04 +02:00
Justin Mayer
cefe984c7e
Merge pull request #2721 from avaris/fix-test-plugins
Test updates
2020-04-14 23:00:23 +02:00
Deniz Turgut
eb05aa8ce5 Add a draft without date for #2488 2020-04-14 23:52:46 +03:00
Deniz Turgut
aa176b7939 Account for existing namespace plugins in plugin tests 2020-04-14 23:52:46 +03:00
Justin Mayer
e10dcfc5e7
Merge pull request #2720 from getpelican/fix-sample-content
Reduce warnings and errors in sample content
2020-04-14 22:06:57 +02:00
Justin Mayer
7eae9b1abc Reduce warnings and errors in sample content
This reduces the warnings and errors when generating the sample content
from twelve to one (intentional) warning. The latter is expected by
assertLogCountEqual() in the "test_basic_generation_works" test.
2020-04-14 21:39:47 +02:00
Justin Mayer
2d590bb8c1 Add HTML meta generator tag to functional test output 2020-04-14 17:47:08 +02:00
Justin Mayer
c8bf3ec5a4 Add HTML meta generator tag to theme base templates 2020-04-14 17:47:07 +02:00
Justin Mayer
3f4166e7b6 Put pre-commit excludes where they actually belong 2020-04-14 17:47:07 +02:00
Justin Mayer
863176040f Don't run pre-commit on functional test output
Otherwise, it will apply EOF and trailing whitespace fixes, which may
lead to test failures.
2020-04-14 14:14:56 +02:00
Justin Mayer
cff6a829c2 Set timezone when assigning max datetime to drafts 2020-04-14 13:48:03 +02:00
Boian Berberov
bf85991ee6
Quote Makefile paths so it handles spaces 2020-04-13 11:17:39 +02:00
Justin Mayer
1a6d66f395 Run tests in parallel on multi-core systems
Uses pytest-xdist to run tests on two cores simultaneously, speeding up
test runs by nearly 40%.
2020-04-13 08:55:29 +02:00
Boian Berberov
fc8a3c719f
Add missing <ul> element to index.html template in notmyidea theme (#2545) 2020-04-12 22:03:48 +02:00
Justin Mayer
276a14ae05
Merge pull request #2687 from LouisJackman/add-devserver-global-make-target
Add a devserver-global Make task for non-local dev testing
2020-04-12 21:49:15 +02:00
Justin Mayer
07c2526c08
Merge pull request #2716 from avaris/limit-filter
Fix LOG_FILTER to act on exact messages
2020-04-12 20:51:33 +02:00
Deniz Turgut
97dbafcb89 Fix LOG_FILTER to act on exact messages
* Adds the ability to filter templated messages by exact message,
as well as templates.
* Adds a test for LimitFilter.

Fixes #2552,  #2682
2020-04-12 21:00:27 +03:00
Justin Mayer
e7ef546661 Add PORT to serve-global Makefile task 2020-04-12 19:43:09 +02:00