Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
New option TAGS_INDEX_PATH for overwriting said path
  • Loading branch information
da2x committed Oct 21, 2015
1 parent ddcd9e9 commit 0c1c59b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Expand Up @@ -4,6 +4,8 @@ New in master
Features
--------

* New ``TAGS_INDEX_PATH`` option for overwriting the path
of the tag index list page.
* Support for ``~~strikethrough~~`` in Markdown (Issue #2149)
* Hungarian translation (by Baptiste Darthenay)
* ``serve`` and ``auto`` publishes DNS Service Discovery records
Expand Down
5 changes: 5 additions & 0 deletions nikola/conf.py.in
Expand Up @@ -274,6 +274,11 @@ POSTS_SECTIONS = True
# (translatable)
# TAG_PATH = "categories"

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

# If TAG_PAGES_ARE_INDEXES is set to True, each tag's page will contain
# the posts themselves. If set to False, it will be just a list of links.
# TAG_PAGES_ARE_INDEXES = False
Expand Down
2 changes: 2 additions & 0 deletions nikola/nikola.py
Expand Up @@ -482,6 +482,7 @@ def __init__(self, **config):
'TAG_PAGES_ARE_INDEXES': False,
'TAG_PAGES_DESCRIPTIONS': {},
'TAG_PAGES_TITLES': {},
'TAGS_INDEX_PATH': '',
'TAGLIST_MINIMUM_POSTS': 1,
'TEMPLATE_FILTERS': {},
'THEME': 'bootstrap3',
Expand Down Expand Up @@ -558,6 +559,7 @@ def __init__(self, **config):
'INDEXES_PRETTY_PAGE_URL',
# PATH options (Issue #1914)
'TAG_PATH',
'TAGS_INDEX_PATH',
'CATEGORY_PATH',
'DATE_FORMAT',
'JS_DATE_FORMAT',
Expand Down
11 changes: 8 additions & 3 deletions nikola/plugins/task/tags.py
Expand Up @@ -399,9 +399,14 @@ def tag_index_path(self, name, lang):
link://tag_index => /tags/index.html
"""
return [_f for _f in [self.site.config['TRANSLATIONS'][lang],
self.site.config['TAG_PATH'][lang],
self.site.config['INDEX_FILE']] if _f]
if self.site.config['TAGS_INDEX_PATH']:
paths = [_f for _f in [self.site.config['TRANSLATIONS'][lang],
self.site.config['TAGS_INDEX_PATH'][lang]] if _f]
else:
paths = [_f for _f in [self.site.config['TRANSLATIONS'][lang],
self.site.config['TAG_PATH'][lang],
self.site.config['INDEX_FILE']] if _f]
return paths

def category_index_path(self, name, lang):
"""A link to the category index.
Expand Down

0 comments on commit 0c1c59b

Please sign in to comment.