1
0
Fork 0
forked from github/pelican
Commit graph

3,376 commits

Author SHA1 Message Date
(GalaxyMaster)
e6df353302
Set "modified:" from "date:" when the latter was set from the filesystem (#2748)
Sets the `modified:` metadata from `date:` if the user asked us
to use the filesystem for determining timestamps. Fixes #2497

* Added tests (ab)using the HTML reader a bit

There seems to be no way to test this generically since we need
to produce a valid document with meta information to be able to
compare, hence I used the lightest reader out there to do the
parsing of the samples.

* Fixed tests for generators since there were 4 more articles
introduced to the test content directory.
2020-05-03 17:45:25 +02:00
Justin Mayer
c8639fe547 Only run Flake8 on changed lines 2020-04-30 21:43:31 +02:00
Justin Mayer
51b873b42e Add Flake8 pre-commit hook 2020-04-30 21:26:02 +02:00
Justin Mayer
e83a8032e8 Flake8 fix 2020-04-30 21:21:14 +02:00
Justin Mayer
a15f2aba76 Ensure path & output path comparisons are absolute
Otherwise, the following error could be returned:
"ValueError: Can't mix absolute and relative paths"
2020-04-30 21:05:47 +02:00
Joachim Lusiardi
82ff563f6f
Expose first and last page of pagination (#2618) 2020-04-30 19:05:48 +02:00
Justin Mayer
2a6b7d9e7c
Merge pull request #2693 from luzpaz/README
Add Repology badge to README
2020-04-30 17:02:06 +02:00
Justin Mayer
d9809c34fc Allow setting host in Invoke serve & livereload tasks
Instead of serving on localhost by default with no way to override, the
host can now be configured, allowing both `serve` and `livereload` tasks
to serve output on non-localhost addresses such as `0.0.0.0`.
2020-04-30 15:21:04 +02:00
Justin Mayer
df2ec7ea14
Merge pull request #2746 from kernc/fix-strings
Fix error strings whitespace
2020-04-30 06:51:45 +02:00
Kernc
b8f7c584c5
Fix error strings whitespace 2020-04-29 18:08:38 +02:00
Justin Mayer
e87717d27c
Merge pull request #2742 from getpelican/remove-legacy
Modernize code base to Python 3+ syntax
2020-04-27 13:12:10 +02:00
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