1
0
Fork 0
forked from github/pelican
Commit graph

3,301 commits

Author SHA1 Message Date
Deniz Turgut
bd699d34e8 Expose preserve_case option from slugify 2020-04-21 00:26:00 +03: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
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
Justin Mayer
0bc6869879
Merge pull request #2713 from getpelican/pin-pygments
Pin Pygments & Jinja to specific versions
2020-04-12 17:07:28 +02:00
Justin Mayer
7d19bcf5d4
Add settings for custom Jinja globals and tests (#2715)
Pelican has a setting for custom Jinja filters but not custom tests or
custom environment namespace globals. This adds both of the latter.
2020-04-12 17:03:53 +02:00
Justin Mayer
9a0a08f460 Update functional test output 2020-04-12 17:02:07 +02:00
Justin Mayer
6cef4ead88 Increase Jinja version minimum to 2.11+
This newer version slightly changes rendered output; upgrading our
dependency means our functional test output will match it more
consistently.
2020-04-12 17:02:06 +02:00
Justin Mayer
e2bbfcb088 Pin Pygments to 2.6.1 2020-04-12 17:02:06 +02:00
Justin Mayer
212742a56f Ensure consistent title spacing in themes
Moving the space between the title and sub-title inside the "if"
statement eliminates a spurious trailing space when there is no
sub-title defined.
2020-04-12 17:02:06 +02:00
Kurt McKee
7bbd3dc6fb
Update links to HTTPS and current 301 redirects in docs/templates/themes (#2661)
This also updates the Tumblr API to use HTTPS as documented in the
current Tumblr API docs.
2020-04-12 16:38:35 +02:00
Justin Mayer
18c7a9c3a1 Pin pytest in pyproject also 2020-04-12 15:38:17 +02:00
Justin Mayer
b6dc55f96c Add poetry.lock to list of files for Git to ignore 2020-04-12 15:21:17 +02:00
Justin Mayer
88100484e0 Move more test deps from CI config to requirements 2020-04-12 15:16:12 +02:00
Justin Mayer
2a5bb109ba Pin pytest until 5.4.x series has stabilized
Version 5.4.1 is currently incompatible with pytest-sugar.
2020-04-12 15:04:22 +02:00
Justin Mayer
0f97f6d488
Merge pull request #2714 from getpelican/skip-md-metadata-parse
Skip Markdown metadata parsing within metadata fields
2020-04-12 14:53:59 +02:00