Filtration is now being applied before caching the metadata, solving the issue where _DISCARD objects from previous runs were being retrieved from cache.
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.
This commit removes Six as a dependency for Pelican, replacing the
relevant aliases with the proper Python 3 imports. It also removes
references to Python 2 logic that did not require Six.
Metadata applied to a directory will apply to all files under
it. In case of conflicts, child paths beat parent paths, so metadata
applied to `dir/subdir/file.md` will take precedence over that applied
to `dir/subdir`, which will take precedence over just `dir`.
This PR removes the Python 3.4 tox task and updates references in the
code to Python 3.5+.
tox complains about Python 3.4, which is EOL after next month:
> py34 installed: DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won't be maintained after March 2019 (cf PEP 429).
this means you can now specify:
<meta name="custom_field" content="value_1" />
<meta name="custom_field" content="value_2" />
and the resulting object.custom_field will be ['value_1', 'value_2']
The RstReader class can now use user-specified writer/translator classes
instead of the hardcoded ones from docutils. This allows for far easier
overriding of the default HTML output -- in the past one would need to
override the internal _parse_metadata() and _get_publisher() functions.
With hypothetical Html5Writer and Html5FieldBodyTranslator classes,
based for example on docutils.writers.html5_polyglot.Writer and
docutils.writers.html5_polyglot.HTMLTranslator, a plugin that overrides
the default behavior would now look just like this:
# (definition of Writer / Translator classes omitted)
class Html5RstReader(RstReader):
writer_class = Html5Writer
field_body_translator_class = Html5FieldBodyTranslator
def add_reader(readers):
readers.reader_classes['rst'] = Html5RstReader
def register():
pelican.signals.readers_init.connect(add_reader)
Starting with python 3.6 warnings are issued for invalid escape
sequences in regular expressions. This commit corrects all
DeprecationWarning's via properly declaring the offending
regular expressions as raw strings.
Resolves#2095.
This is relevant when using optional items in the expression. E.g. if an
optional captured group is not matched, the result of
`match.groupdict()` contains the captured group with value `None`.
Also it may be allowed in the future (to process multiple values).
Also @avaris think it's bad to test something twice (see
https://github.com/getpelican/pelican/pull/2017), but for me confusion
lies in the "Why is list processing forbidden?", so, in a way, our
ideas converges in "let's not disallow processed items to be lists".
This reverts commit 9e574e9d8c.