Skip to content
Permalink
Browse files
Fix #3008 -- make compiler metadata less important
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Apr 25, 2018
1 parent cb122fe commit 53b3761ac06ac009cc0af9b056a03ae40dbe78ae
Showing with 9 additions and 6 deletions.
  1. +3 −1 CHANGES.txt
  2. +6 −5 nikola/post.py
@@ -61,7 +61,9 @@ Features
Bugfixes
--------

* Renamed ``DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED`` to ``DISABLE_INDEXES``
* Read file metadata if compiler metadata exists and prefer it over
compiler metadata (Issue #3008)
* Rename ``DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED`` to ``DISABLE_INDEXES``
and ``DISABLE_INDEXES_PLUGIN_RSS_FEED`` to ``DISABLE_MAIN_RSS_FEED`` (Issue #3039)
* Make chart shortcode its own plugin and make the reST directive
depend on it.
@@ -1012,9 +1012,9 @@ def get_meta(post, lang):
metadata_extractors_by = metadata_extractors.default_metadata_extractors_by()

# If meta file exists, use it
meta.update(get_metadata_from_meta_file(post.metadata_path, post, config, lang, metadata_extractors_by))
metafile_meta = get_metadata_from_meta_file(post.metadata_path, post, config, lang, metadata_extractors_by)

if not meta:
if not metafile_meta:
post.is_two_file = False

# Fetch compiler metadata.
@@ -1026,11 +1026,12 @@ def get_meta(post, lang):
used_extractor = post.compiler
meta.update(compiler_meta)

if not post.is_two_file and not compiler_meta:
# Meta file has precedence over file, which can contain garbage.
# Moreover, we should not read the file if we have compiler meta.
# Meta files and inter-file metadata override compiler metadata
if not post.is_two_file:
new_meta, used_extractor = get_metadata_from_file(post.source_path, post, config, lang, metadata_extractors_by)
meta.update(new_meta)
else:
meta.update(metafile_meta)

# Filename-based metadata extractors (fallback only)
if not meta:

0 comments on commit 53b3761

Please sign in to comment.