Skip to content
Permalink
Browse files
Don't use Post.source_path directly to determine translated post's so…
…urce file name. Allowing Post.translated_source_path() to return None.
  • Loading branch information
felixfontein committed Feb 16, 2017
1 parent e8dab6d commit 147dc60b243dedffe3d99b9888fe0a12aacaa68d
Showing with 4 additions and 7 deletions.
  1. +2 −1 nikola/nikola.py
  2. +2 −6 nikola/plugins/task/sources.py
@@ -2094,7 +2094,8 @@ def scan_posts(self, really=False, ignore_quit=False, quiet=False):
quit = True
self.post_per_file[dest] = post
self.post_per_file[src_dest] = post
self.post_per_input_file[src_file] = post
if src_file is not None:
self.post_per_input_file[src_file] = post
# deduplicate tags_per_language
self.tags_per_language[lang] = list(set(self.tags_per_language[lang]))

@@ -61,12 +61,8 @@ def gen_tasks(self):
# do not publish PHP sources
if post.source_ext(True) == post.compiler.extension():
continue
source = post.source_path
if lang != kw["default_lang"]:
source_lang = utils.get_translation_candidate(self.site.config, source, lang)
if os.path.exists(source_lang):
source = source_lang
if os.path.isfile(source):
source = post.translated_source_path(lang)
if source is not None and os.path.isfile(source):
yield {
'basename': 'render_sources',
'name': os.path.normpath(output_name),

0 comments on commit 147dc60

Please sign in to comment.