Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 623b4e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -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.
Expand Down
9 changes: 6 additions & 3 deletions nikola/post.py
Expand Up @@ -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 = {}
Expand All @@ -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:
Expand All @@ -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


Expand Down

0 comments on commit 623b4e7

Please sign in to comment.