Skip to content

Commit

Permalink
Improve style for 9ed0cfa/#3081
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 9, 2018
1 parent 9ed0cfa commit 26c8f2b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions nikola/plugins/task/categories.py
Expand Up @@ -127,16 +127,15 @@ def get_path(self, classification, lang, dest_type='page'):
cat_string = '/'.join(classification)
if self.site.config['CATEGORY_PAGES_FOLLOW_DESTPATH']:
base_dir = None
sub_dir = []
for post in self.site.posts_per_category[cat_string]:
if post.category_from_destpath:
base_dir = post.folder_base(lang) + os.sep + os.sep.join(classification)
base_dir = post.folder_base(lang)
break
# fallback: first POSTS entry + classification
if base_dir is None:
base_dir = self.site.config['POSTS'][0][1]
sub_dir = [self.slugify_tag_name(part, lang) for part in classification]
base_dir_list = base_dir.split(os.sep)
sub_dir = [self.slugify_tag_name(part, lang) for part in classification]
return [_f for _f in (base_dir_list + sub_dir) if _f], 'auto'
else:
return [_f for _f in [self.site.config['CATEGORY_PATH'](lang)] if _f] + self.slugify_category_name(
Expand Down

0 comments on commit 26c8f2b

Please sign in to comment.