Skip to content
Permalink
Browse files

Getting rid of _force_source.

  • Loading branch information...
felixfontein committed Sep 26, 2016
1 parent ceea3d0 commit e05e806b09b8580229aa55a7815c18495931c4c3
Showing with 7 additions and 10 deletions.
  1. +7 −10 nikola/post.py
@@ -762,26 +762,23 @@ def remaining_paragraph_count(self):
def source_link(self, lang=None):
"""Return absolute link to the post's source."""
ext = self.source_ext(True)
link = "/" + self.destination_path(lang=lang, extension=ext, sep='/', _force_source=True)
link = "/" + self.destination_path(lang=lang, extension=ext, sep='/')
link = utils.encodelink(link)
return link

def destination_path(self, lang=None, extension='.html', sep=os.sep, _force_source=False):
def destination_path(self, lang=None, extension='.html', sep=os.sep):
"""Destination path for this post, relative to output/.
If lang is not specified, it's the current language.
Extension is used in the path if specified.
"""
if lang is None:
lang = nikola.utils.LocaleBorg().current_lang
if _force_source:
folder = self.folder
else:
folder = self.meta[lang].get('path', self.folder_relative)
if isinstance(self.folder_base, (utils.bytes_str, utils.unicode_str)):
folder = os.path.normpath(os.path.join(self.folder_base, folder))
elif self.folder_base is not None:
folder = os.path.normpath(os.path.join(self.folder_base(lang), folder))
folder = self.meta[lang].get('path', self.folder_relative)
if isinstance(self.folder_base, (utils.bytes_str, utils.unicode_str)):
folder = os.path.normpath(os.path.join(self.folder_base, folder))
elif self.folder_base is not None:
folder = os.path.normpath(os.path.join(self.folder_base(lang), folder))
if self._has_pretty_url(lang):
path = os.path.join(self.translations[lang],
folder, self.meta[lang]['slug'], 'index' + extension)

0 comments on commit e05e806

Please sign in to comment.
You can’t perform that action at this time.