Skip to content
Permalink
Browse files
Fix #3191 -- set one-file basing on default language
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Dec 31, 2018
1 parent 38a6930 commit 623b4e78fb209f3c059a8e0fcce675f999351a3c
Showing with 7 additions and 3 deletions.
  1. +1 −0 CHANGES.txt
  2. +6 −3 nikola/post.py
@@ -4,6 +4,7 @@ New in master
Bugfixes
--------

* Set one-file status basing on default language only (Issue #3191)
* Don’t warn if post status is set to ``published`` explicitly
(Issue #3181)
* Remove mention of Twitter cards requiring an opt-in.
@@ -1029,8 +1029,7 @@ def get_meta(post, lang):
# If meta file exists, use it
metafile_meta, used_extractor = get_metadata_from_meta_file(post.metadata_path, post, config, lang, metadata_extractors_by)

if not metafile_meta:
post.is_two_file = False
is_two_file = bool(metafile_meta)

# Fetch compiler metadata.
compiler_meta = {}
@@ -1042,7 +1041,7 @@ def get_meta(post, lang):
meta.update(compiler_meta)

# Meta files and inter-file metadata override compiler metadata
if not post.is_two_file:
if not metafile_meta:
new_meta, used_extractor = get_metadata_from_file(post.source_path, post, config, lang, metadata_extractors_by)
meta.update(new_meta)
else:
@@ -1068,6 +1067,10 @@ def get_meta(post, lang):
meta['title'] = os.path.splitext(
os.path.basename(post.source_path))[0]

# Set one-file status basing on default language only (Issue #3191)
if is_two_file or lang is None:
post.is_two_file = is_two_file

return meta, used_extractor


0 comments on commit 623b4e7

Please sign in to comment.