Skip to content
Permalink
Browse files
Fix #3081 — Make CATEGORY_PAGES_FOLLOW_DESTPATH more resilient
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 9, 2018
1 parent 2cb25fb commit 9ed0cfa0d1ae0f27f899809cf51bcc0f73f6ff6c
Showing with 2 additions and 6 deletions.
  1. +1 −0 CHANGES.txt
  2. +1 −6 nikola/plugins/task/categories.py
@@ -9,6 +9,7 @@ Features
Bugfixes
--------

* Make ``CATEGORY_PAGES_FOLLOW_DESTPATH`` more resilient (Issue #3081)
* Guard against null items in gallery meta files (Issues #3076, #3077)
* Respect ``USE_FILENAME_AS_TITLE`` in galleries with a meta file
* Fix gallery metadata for multilingual sites (Issue #3078)
@@ -130,12 +130,7 @@ def get_path(self, classification, lang, dest_type='page'):
sub_dir = []
for post in self.site.posts_per_category[cat_string]:
if post.category_from_destpath:
if not self.site.config['CATEGORY_DESTPATH_FIRST_DIRECTORY_ONLY']:
base_dir = post.folders[lang]
elif post.folder_relative == '.':
base_dir = post.folder_base(lang)
else:
base_dir = post.folder_base(lang) + os.sep + post.folder_relative
base_dir = post.folder_base(lang) + os.sep + os.sep.join(classification)
break
# fallback: first POSTS entry + classification
if base_dir is None:

0 comments on commit 9ed0cfa

Please sign in to comment.