Skip to content

Commit

Permalink
FEED_EXTENSION -> ATOM_EXTENSION; adding extensions to global context…
Browse files Browse the repository at this point in the history
… and documenting them.
  • Loading branch information
felixfontein committed Apr 15, 2018
1 parent 0f3f219 commit d0bb8b0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions docs/template-variables.rst
Expand Up @@ -40,6 +40,7 @@ Name Type Descript
``_link`` function ``Nikola.link`` function
``abs_link`` function ``Nikola.abs_link`` function
``author_pages_generated`` bool False
``atom_extension`` str ``ATOM_EXTENSION`` setting
``blog_author`` TranslatableSetting<str> ``BLOG_AUTHOR`` setting
``blog_email`` str ``BLOG_EMAIL`` setting
``blog_description`` TranslatableSetting<str> ``BLOG_DESCRIPTION`` setting
Expand Down Expand Up @@ -87,6 +88,8 @@ Name Type Descript
``posts_section_name`` TranslatableSetting<str> ``POSTS_SECTION_NAME`` setting
``posts_section_title`` TranslatableSetting<str> ``POSTS_SECTION_TITLE`` setting
``rel_link`` function ``Nikola.rel_link`` function
``rss_extension`` str ``RSS_EXTENSION`` setting
``rss_filename_base`` TranslatableSetting<str> ``RSS_FILENAME_BASE`` setting
``rss_link`` str ``RSS_LINK`` setting
``rss_path`` TranslatableSetting<str> ``RSS_PATH`` setting
``search_form`` TranslatableSetting<str> ``SEARCH_FORM`` setting
Expand Down
2 changes: 1 addition & 1 deletion nikola/conf.py.in
Expand Up @@ -1067,7 +1067,7 @@ MARKDOWN_EXTENSIONS = ['markdown.extensions.fenced_code', 'markdown.extensions.c
# GENERATE_ATOM = False

# Extension for Atom feed files
# FEED_EXTENSION = ".atom"
# ATOM_EXTENSION = ".atom"

# Only include teasers in Atom and RSS feeds. Disabling include the full
# content. Defaults to True.
Expand Down
4 changes: 3 additions & 1 deletion nikola/nikola.py
Expand Up @@ -538,7 +538,7 @@ def __init__(self, **config):
'REDIRECTIONS': [],
'ROBOTS_EXCLUSIONS': [],
'GENERATE_ATOM': False,
'FEED_EXTENSION': '.atom',
'ATOM_EXTENSION': '.atom',
'FEED_TEASERS': True,
'FEED_PLAIN': False,
'FEED_PREVIEWIMAGE': True,
Expand Down Expand Up @@ -1121,6 +1121,8 @@ def _set_global_context_from_config(self):
'CONTENT_FOOTER')
self._GLOBAL_CONTEXT['generate_atom'] = self.config.get('GENERATE_ATOM')
self._GLOBAL_CONTEXT['generate_rss'] = self.config.get('GENERATE_RSS')
self._GLOBAL_CONTEXT['atom_extension'] = self.config.get('ATOM_EXTENSION')
self._GLOBAL_CONTEXT['rss_extension'] = self.config.get('RSS_EXTENSION')
self._GLOBAL_CONTEXT['rss_path'] = self.config.get('RSS_PATH')
self._GLOBAL_CONTEXT['rss_filename_base'] = self.config.get('RSS_FILENAME_BASE')
self._GLOBAL_CONTEXT['rss_link'] = self.config.get('RSS_LINK')
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/misc/taxonomies_classifier.py
Expand Up @@ -233,7 +233,7 @@ def _postprocess_path(self, path, lang, append_index='auto', dest_type='page', p
# Forcing extension for Atom feeds and RSS feeds
force_extension = None
if dest_type == 'feed':
force_extension = self.site.config['FEED_EXTENSION']
force_extension = self.site.config['ATOM_EXTENSION']
elif dest_type == 'rss':
force_extension = '.xml'
# Determine how to extend path
Expand Down

0 comments on commit d0bb8b0

Please sign in to comment.