Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
RSS_PATH_FILENAME_BASE -> RSS_FILENAME_BASE.
  • Loading branch information
felixfontein committed Apr 15, 2018
1 parent a5c8f38 commit 58388b3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
9 changes: 6 additions & 3 deletions nikola/conf.py.in
Expand Up @@ -249,7 +249,7 @@ POSTS_SECTIONS = True

# Final locations are:
# output / TRANSLATION[lang] / SECTION_PATH / SECTION_NAME / index.html (list of posts for a section)
# output / TRANSLATION[lang] / SECTION_PATH / SECTION_NAME / rss RSS_EXTENSION (RSS feed for a section)
# output / TRANSLATION[lang] / SECTION_PATH / SECTION_NAME / RSS_FILENAME_BASE RSS_EXTENSION (RSS feed for a section)
# (translatable)
# SECTION_PATH = ""

Expand Down Expand Up @@ -518,11 +518,14 @@ USE_BASE_TAG = False
# Extension for RSS feed files
# RSS_EXTENSION = ".xml"

# RSS filename base (without extension); used for indexes, sections and galleries.
# (translatable)
# RSS_FILENAME_BASE = "rss"

# Final location for the blog main RSS feed is:
# output / TRANSLATION[lang] / RSS_PATH / RSS_PATH_FILENAME_BASE RSS_EXTENSION
# output / TRANSLATION[lang] / RSS_PATH / RSS_FILENAME_BASE RSS_EXTENSION
# (translatable)
# RSS_PATH = ""
# RSS_PATH_FILENAME_BASE = "rss"

# Slug the Tag URL. Easier for users to type, special characters are
# often removed or replaced as well.
Expand Down
8 changes: 4 additions & 4 deletions nikola/nikola.py
Expand Up @@ -548,7 +548,7 @@ def __init__(self, **config):
'RSS_EXTENSION': '.xml',
'RSS_LINK': None,
'RSS_PATH': '',
'RSS_PATH_FILENAME_BASE': 'rss',
'RSS_FILENAME_BASE': 'rss',
'SEARCH_FORM': '',
'SHOW_BLOG_TITLE': True,
'SHOW_INDEX_PAGE_NAVIGATION': False,
Expand Down Expand Up @@ -656,7 +656,7 @@ def __init__(self, **config):
'SECTION_PATH',
'INDEX_PATH',
'RSS_PATH',
'RSS_PATH_FILENAME_BASE',
'RSS_FILENAME_BASE',
'AUTHOR_PATH',
'DATE_FORMAT',
'JS_DATE_FORMAT',
Expand All @@ -683,7 +683,7 @@ def __init__(self, **config):
'posts_section_title',
'front_index_header',
'rss_path',
'rss_path_filename_base',
'rss_filename_base',
)
# WARNING: navigation_links SHOULD NOT be added to the list above.
# Themes ask for [lang] there and we should provide it.
Expand Down Expand Up @@ -1122,7 +1122,7 @@ def _set_global_context_from_config(self):
self._GLOBAL_CONTEXT['generate_atom'] = self.config.get('GENERATE_ATOM')
self._GLOBAL_CONTEXT['generate_rss'] = self.config.get('GENERATE_RSS')
self._GLOBAL_CONTEXT['rss_path'] = self.config.get('RSS_PATH')
self._GLOBAL_CONTEXT['rss_path_filename_base'] = self.config.get('RSS_PATH_FILENAME_BASE')
self._GLOBAL_CONTEXT['rss_filename_base'] = self.config.get('RSS_FILENAME_BASE')
self._GLOBAL_CONTEXT['rss_link'] = self.config.get('RSS_LINK')

self._GLOBAL_CONTEXT['navigation_links'] = self.config.get('NAVIGATION_LINKS')
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/galleries.py
Expand Up @@ -162,7 +162,7 @@ def gallery_rss_path(self, name, lang):
gallery_path = self._find_gallery_path(name)
return [_f for _f in [self.site.config['TRANSLATIONS'][lang]] +
gallery_path.split(os.sep) +
['rss' + self.site.config['RSS_EXTENSION']] if _f]
[self.site.config['RSS_FILENAME_BASE'](lang) + self.site.config['RSS_EXTENSION']] if _f]

def gen_tasks(self):
"""Render image galleries."""
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/indexes.py
Expand Up @@ -93,7 +93,7 @@ def get_path(self, classification, lang, dest_type='page'):
if dest_type == 'rss':
return [
self.site.config['RSS_PATH'](lang),
self.site.config['RSS_PATH_FILENAME_BASE'](lang)
self.site.config['RSS_FILENAME_BASE'](lang)
], 'auto'
# 'page' (index) or 'feed' (Atom)
page_number = None
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/sections.py
Expand Up @@ -100,7 +100,7 @@ def get_path(self, section, lang, dest_type='page'):
"""Return a path for the given classification."""
result = [_f for _f in [self.site.config['SECTION_PATH'](lang), section] if _f]
if dest_type == 'rss':
return result + ['rss' + self.site.config['RSS_EXTENSION']], 'never'
return result + [self.site.config['RSS_FILENAME_BASE'](lang) + self.site.config['RSS_EXTENSION']], 'never'
return result, 'always'

def provide_context_and_uptodate(self, classification, lang, node=None):
Expand Down

0 comments on commit 58388b3

Please sign in to comment.