Skip to content
Permalink
Browse files

Added new setting CATEGORIES_INDEX_PATH (fixes #2567).

  • Loading branch information
felixfontein committed Dec 2, 2016
1 parent fee0925 commit c3d16dc90c18728645c292d40bf51c1d43870dc8
Showing with 13 additions and 1 deletion.
  1. +2 −0 CHANGES.txt
  2. +5 −0 nikola/conf.py.in
  3. +2 −0 nikola/nikola.py
  4. +4 −1 nikola/plugins/task/categories.py
@@ -28,6 +28,8 @@ Features
create new taxonomies. Some of the existing taxonomies (authors,
archives, indexes, page index, sections, tags, and categories)
have been converted to the new system. (Issue #2107)
* Added ``CATEGORIES_INDEX_PATH``, similar to ``TAGS_INDEX_PATH``.
(Issue #2567)

New in v7.8.1
=============
@@ -333,6 +333,11 @@ HIDDEN_TAGS = ['mathjax']
# CATEGORY_PATH = "categories"
# CATEGORY_PREFIX = "cat_"

# See CATEGORY_PATH's "list of categories" for the default setting value. Can be overwritten
# here any path relative to the output directory.
# (translatable)
# CATEGORIES_INDEX_PATH = "tags.html"

# If CATEGORY_ALLOW_HIERARCHIES is set to True, categories can be organized in
# hierarchies. For a post, the whole path in the hierarchy must be specified,
# using a forward slash ('/') to separate paths. Use a backslash ('\') to escape
@@ -439,6 +439,7 @@ def __init__(self, **config):
'BLOG_DESCRIPTION': 'Default Description',
'BODY_END': "",
'CACHE_FOLDER': 'cache',
'CATEGORIES_INDEX_PATH': '',
'CATEGORY_PATH': None, # None means: same as TAG_PATH
'CATEGORY_PAGES_ARE_INDEXES': None, # None means: same as TAG_PAGES_ARE_INDEXES
'CATEGORY_PAGES_DESCRIPTIONS': {},
@@ -647,6 +648,7 @@ def __init__(self, **config):
'TAG_PATH',
'TAGS_INDEX_PATH',
'CATEGORY_PATH',
'CATEGORIES_INDEX_PATH',
'DATE_FORMAT',
'JS_DATE_FORMAT',
)
@@ -83,7 +83,10 @@ def get_classification_friendly_name(self, classification, lang, only_last_compo

def get_list_path(self, lang, type='page'):
"""A path handler for the list of all classifications."""
return [_f for _f in [self.site.config['CATEGORY_PATH'][lang]] if _f], 'always'
if self.site.config['CATEGORIES_INDEX_PATH'][lang]:
return [_f for _f in [self.site.config['CATEGORIES_INDEX_PATH'][lang]] if _f], 'never'
else:
return [_f for _f in [self.site.config['CATEGORY_PATH'][lang]] if _f], 'always'

def slugify_tag_name(self, name, lang):
"""Slugify a tag name."""

0 comments on commit c3d16dc

Please sign in to comment.