Repository: getnikola/nikola

Issue:
Rename DISABLE_INDEXES_PLUGIN_* settings
This sucks:

```py
DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED = False
DISABLE_INDEXES_PLUGIN_RSS_FEED = False
```

Better:

```py
# Disable indexes (/index.html) and main Atom feed (/index.atom)
DISABLE_INDEXES = False
# Disable main RSS feed (/rss.xml). See also: GENERATE_RSS (to disable all RSS feeds)
DISABLE_MAIN_RSS_FEED = False
```


Discussion:

Resolving patch:
diff --git a/nikola/nikola.py b/nikola/nikola.py
--- a/nikola/nikola.py
+++ b/nikola/nikola.py
@@ -456,8 +456,8 @@ def __init__(self, **config):
             'CREATE_FULL_ARCHIVES': False,
             'CREATE_DAILY_ARCHIVE': False,
             'DATE_FORMAT': '%Y-%m-%d %H:%M',
-            'DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED': False,
-            'DISABLE_INDEXES_PLUGIN_RSS_FEED': False,
+            'DISABLE_INDEXES': False,
+            'DISABLE_MAIN_RSS_FEED': False,
             'JS_DATE_FORMAT': 'YYYY-MM-DD HH:mm',
             'DATE_FANCINESS': 0,
             'DEFAULT_LANG': "en",
@@ -715,6 +715,14 @@ def __init__(self, **config):
             utils.LOGGER.warn('The UNSLUGIFY_TITLES setting was renamed to FILE_METADATA_UNSLUGIFY_TITLES.')
             self.config['FILE_METADATA_UNSLUGIFY_TITLES'] = self.config['UNSLUGIFY_TITLES']
 
+        if 'DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED' in self.config:
+            utils.LOGGER.warn('The DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED setting was renamed to DISABLE_INDEXES.')
+            self.config['DISABLE_INDEXES'] = self.config['DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED']
+
+        if 'DISABLE_INDEXES_PLUGIN_RSS_FEED' in self.config:
+            utils.LOGGER.warn('The DISABLE_INDEXES_PLUGIN_RSS_FEED setting was renamed to DISABLE_MAIN_RSS_FEED.')
+            self.config['DISABLE_MAIN_RSS_FEED'] = self.config['DISABLE_INDEXES_PLUGIN_RSS_FEED']
+
         # Handle CONTENT_FOOTER and RSS_COPYRIGHT* properly.
         # We provide the arguments to format in CONTENT_FOOTER_FORMATS and RSS_COPYRIGHT_FORMATS.
         self.config['CONTENT_FOOTER'].langformat(self.config['CONTENT_FOOTER_FORMATS'])
@@ -757,16 +765,16 @@ def __init__(self, **config):
                     utils.LOGGER.warn('You are disabling the "render_indexes" plugin, as well as disabling the "generate_rss" plugin or setting GENERATE_RSS to False. To achieve the same effect, please disable the "classify_indexes" plugin in the future.')
                     self.config['DISABLED_PLUGINS'].append('classify_indexes')
             else:
-                if not self.config['DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED']:
-                    utils.LOGGER.warn('You are disabling the "render_indexes" plugin, but not the generation of RSS feeds. Please put "DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED = True" into your configuration instead.')
-                    self.config['DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED'] = True
+                if not self.config['DISABLE_INDEXES']:
+                    utils.LOGGER.warn('You are disabling the "render_indexes" plugin, but not the generation of RSS feeds. Please put "DISABLE_INDEXES = True" into your configuration instead.')
+                    self.config['DISABLE_INDEXES'] = True
 
         # Disable RSS.  For a successful disable, we must have both the option
         # false and the plugin disabled through the official means.
         if 'generate_rss' in self.config['DISABLED_PLUGINS'] and self.config['GENERATE_RSS'] is True:
             utils.LOGGER.warn('Please use GENERATE_RSS to disable RSS feed generation, instead of mentioning generate_rss in DISABLED_PLUGINS.')
             self.config['GENERATE_RSS'] = False
-            self.config['DISABLE_INDEXES_PLUGIN_RSS_FEED'] = True
+            self.config['DISABLE_MAIN_RSS_FEED'] = True
 
         # PRETTY_URLS defaults to enabling STRIP_INDEXES unless explicitly disabled
         if self.config.get('PRETTY_URLS') and 'STRIP_INDEXES' not in config:
diff --git a/nikola/plugins/task/indexes.py b/nikola/plugins/task/indexes.py
--- a/nikola/plugins/task/indexes.py
+++ b/nikola/plugins/task/indexes.py
@@ -119,8 +119,8 @@ def provide_context_and_uptodate(self, classification, lang, node=None):
 
     def should_generate_classification_page(self, classification, post_list, lang):
         """Only generates list of posts for classification if this function returns True."""
-        return not self.site.config["DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED"]
+        return not self.site.config["DISABLE_INDEXES"]
 
     def should_generate_rss_for_classification_page(self, classification, post_list, lang):
         """Only generates RSS feed for list of posts for classification if this function returns True."""
-        return not self.site.config["DISABLE_INDEXES_PLUGIN_RSS_FEED"]
+        return not self.site.config["DISABLE_MAIN_RSS_FEED"]
diff --git a/nikola/plugins/task/pages.py b/nikola/plugins/task/pages.py
--- a/nikola/plugins/task/pages.py
+++ b/nikola/plugins/task/pages.py
@@ -51,7 +51,7 @@ def gen_tasks(self):
         index_paths = {}
         for lang in kw["translations"]:
             index_paths[lang] = False
-            if not self.site.config["DISABLE_INDEXES_PLUGIN_INDEX_AND_ATOM_FEED"]:
+            if not self.site.config["DISABLE_INDEXES"]:
                 index_paths[lang] = os.path.normpath(os.path.join(self.site.config['OUTPUT_FOLDER'],
                                                      self.site.path('index', '', lang=lang)))
 


Test patch: