Skip to content

Commit

Permalink
Allowing to prevent Atom feed generation for classification post list…
Browse files Browse the repository at this point in the history
…s. (Nobody wants that except tag and category pages.)
  • Loading branch information
felixfontein committed Oct 19, 2016
1 parent 966cb94 commit 9e55cbb
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions nikola/plugin_categories.py
Expand Up @@ -497,6 +497,8 @@ class Taxonomy(BasePlugin):
# Whether to show the posts for one classification as an index or
# as a post list.
show_list_as_index = False
# Whether to generate Atom feeds for post lists in case GENERATE_ATOM is set.
generate_atom_feeds_for_post_lists = False
# The template to use for the post list for one classification.
template_for_list_of_one_classification = "tagindex.tmpl"
# The template to use for the classification overview page.
Expand Down
1 change: 1 addition & 0 deletions nikola/plugins/task/archive.py
Expand Up @@ -44,6 +44,7 @@ class Archive(Taxonomy):
has_hierarchy = True
include_posts_from_subhierarchies = True
include_posts_into_hierarchy_root = True
generate_atom_feeds_for_post_lists = False
template_for_classification_overview = None
apply_to_posts = True
apply_to_pages = False
Expand Down
1 change: 1 addition & 0 deletions nikola/plugins/task/authors.py
Expand Up @@ -42,6 +42,7 @@ class ClassifyAuthors(Taxonomy):
overview_page_variable_name = "authors"
more_than_one_classifications_per_post = False
has_hierarchy = False
generate_atom_feeds_for_post_lists = False
template_for_classification_overview = "authors.tmpl"
apply_to_posts = True
apply_to_pages = False
Expand Down
1 change: 1 addition & 0 deletions nikola/plugins/task/page_index.py
Expand Up @@ -43,6 +43,7 @@ class PageIndex(Taxonomy):
has_hierarchy = True
include_posts_from_subhierarchies = False
show_list_as_index = False
generate_atom_feeds_for_post_lists = False
template_for_list_of_one_classification = "list.tmpl"
template_for_classification_overview = None
apply_to_posts = False
Expand Down
1 change: 1 addition & 0 deletions nikola/plugins/task/sections.py
Expand Up @@ -41,6 +41,7 @@ class ClassifySections(Taxonomy):
overview_page_variable_name = "sections"
more_than_one_classifications_per_post = False
has_hierarchy = False
generate_atom_feeds_for_post_lists = False
template_for_classification_overview = None
apply_to_posts = True
apply_to_pages = False
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/taxonomies.py
Expand Up @@ -201,7 +201,7 @@ def _generate_classification_page_as_list(self, taxonomy, classification, filter
task['basename'] = str(self.name)
yield task

if self.site.config['GENERATE_ATOM']:
if taxonomy.generate_atom_feeds_for_post_lists and self.site.config['GENERATE_ATOM']:
yield self._generate_classification_page_as_list_atom(kind, taxonomy, classification, filtered_posts, context, kw, lang)

def _filter_list(self, post_list, lang):
Expand Down

0 comments on commit 9e55cbb

Please sign in to comment.