1
0
Fork 0
forked from github/pelican
Commit graph

1,897 commits

Author SHA1 Message Date
kernc
21c9ce1b73 Rename setting SUMMARY_END_MARKER → SUMMARY_END_SUFFIX (#2792)
Avoids clash with 'summary' plugin.

Refs: https://github.com/getpelican/pelican-plugins/pull/1284#issuecomment-660715086
2020-08-20 11:27:49 +02:00
Justin Mayer
01b08bd812 Rename branch for GitHub Pages repo quickstart 2020-08-20 11:27:49 +02:00
John T. Wodder II
c7cb9a7587 Lowercase metadata field name when comparing with FORMATTED_FIELDS in rST reader 2020-08-20 11:27:49 +02:00
Justin Mayer
3564e6bbe7 Support Booleans in --extra-settings. Refs #2789 2020-08-20 11:27:49 +02:00
Justin Mayer
4c440e6b7d Fix error in --extra-settings feature. Refs #2789 2020-08-20 11:27:49 +02:00
David Beitey
541dd72cc0 Remove duplicate port arguments in Makefile
The PORT variable check earlier in the Makefile sets up the `-p` argument as part of PELICANOPTS so prior to this change `-p` was duplicated on each of the serve targets.
2020-08-20 11:27:49 +02:00
Arnaud Rebillout
c6241180cc Makefile, include tags directory in rsync command
By default, the rsync option '--cvs-exclude' excludes the 'tags'
directory. For a blog, it's a bit unfortunate, as it's quite common to
have a `tags` directory in a blog, either for the tag pages or the tag
feeds.

With this commit, we force rsync to include this directory, and save a
little headache to users who wonder why their tags are present in the
output directory, but are not present on the server.
2020-08-20 11:27:49 +02:00
Justin Mayer
e545a47cdc Rename CLI flag syntax for settings override feature 2020-08-20 11:27:49 +02:00
Peter Sabaini
923a29aaad Override settings from the command line
Add a --setting-overrides KEY=VAL command line option to override
default settings or those defined in settings files. This adds
flexibility in running Pelican and helps reduce sprawl of settings
files. Cast int and str setting overrides to their respective types.
Support other setting types by treating them as JSON. Fall back to JSON
when an override typecast errors. This should make it possible to set
int values to None, resp. to JSON 'none'
2020-08-20 11:27:49 +02:00
Lucas Cimon
ee80399be1
Fixups post-review 2020-06-09 18:12:24 +02:00
Lucas Cimon
d3c4bcc254
Invoke template : avoiding to spawn unnecessary process + passing-through CLI args to pelican 2020-06-09 16:01:46 +02:00
Kernc
cd3048d4cf
Force root logger to be of FatalLogger class
This enforces FatalLogger policy upon pelican plugins
that might contain codes such as:

    import logging
    log = logging.getLogger()

    log.warning(...)
    # or
    logging.warning(...)
2020-06-05 01:50:00 +02:00
Justin Mayer
d0457dcfb8 Build settings paths as strings
… instead of `posix_join`. Fixes #2431
2020-05-18 06:35:33 +02:00
Deniz Turgut
873df9094a
fix linting errors 2020-05-12 23:30:03 +03:00
Justin Mayer
ca1c58e201
Merge pull request #2753 from avaris/log-dict
Fix dictionary logging in formatter
2020-05-10 07:32:54 +02:00
Justin Mayer
2eb9c26cdb
Merge pull request #2750 from avaris/autoreload
Refactor file/folder watchers and autoreload
2020-05-10 07:29:27 +02:00
Deniz Turgut
50281c42e5
Fix dictionary logging in formatter
Python special cases single Mapping arguments to logging. This
adjusts BaseFormatter to skip "fancy" formatting if argument
is of type Mapping. Also adds various formatted log outputs.
2020-05-09 21:25:38 +03:00
Deniz Turgut
c19075816b
use context manager for log testing 2020-05-09 19:30:21 +03:00
Deniz Turgut
48d842faa7
Refactor file/folder watchers and autoreload
Combined file and folder watchers under a class and refactored
common watcher related code from __init__.py to the class.
This simplifies the main and autoreload functions in __init__
as well as fix the problem with crashes related to multiprocessing
on systems where default spawn mode is "spawn" instead of "fork".
2020-05-09 16:22:36 +03:00
Deniz Turgut
2e482b207b
Fix Windows tests
* Unskip passable tests
* Fix broken tests
2020-05-09 16:17:14 +03:00
Deniz Turgut
839629b102
Cleanup test environment and requirements
- pytest: verbose isn't needed but show skipped tests
- mock is not needed anymore. it is part of stdlib
- Unpin Sphinx and fix warning about lexer
- Mirror tox command for doc build in tasks.py
2020-05-09 16:17:14 +03:00
(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
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
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
Kernc
b8f7c584c5
Fix error strings whitespace 2020-04-29 18:08:38 +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
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
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
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
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
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
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
Deniz Turgut
eb05aa8ce5 Add a draft without date for #2488 2020-04-14 23:52:46 +03:00