Skip to content

Commit

Permalink
Split Atom generation out of index generation
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 1, 2018
1 parent ecedddd commit c21b788
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
14 changes: 9 additions & 5 deletions nikola/plugin_categories.py
Expand Up @@ -643,18 +643,18 @@ class Taxonomy(BasePlugin):
The template to use for the subcategories list when
show_list_as_subcategories_list is True.
generate_atom_feeds_for_post_lists = False:
Whether to generate Atom feeds for post lists in case GENERATE_ATOM is set.
template_for_single_list = "tagindex.tmpl":
The template to use for the post list for one classification.
template_for_classification_overview = "list.tmpl":
The template to use for the classification overview page.
Set to None to avoid generating overviews.
always_disable_atom = False:
Whether to always disable Atom feed generation.
always_disable_rss = False:
Whether to always disable RSS feed generation
Whether to always disable RSS feed generation.
apply_to_posts = True:
Whether this classification applies to posts.
Expand Down Expand Up @@ -698,9 +698,9 @@ class Taxonomy(BasePlugin):
show_list_as_subcategories_list = False
show_list_as_index = False
subcategories_list_template = "taxonomy_list.tmpl"
generate_atom_feeds_for_post_lists = False
template_for_single_list = "tagindex.tmpl"
template_for_classification_overview = "list.tmpl"
always_disable_atom = False
always_disable_rss = False
apply_to_posts = True
apply_to_pages = False
Expand Down Expand Up @@ -860,6 +860,10 @@ def should_generate_classification_page(self, classification: str, post_list: 't
"""Only generates list of posts for classification if this function returns True."""
return True

def should_generate_atom_for_classification_page(self, classification: str, post_list: 'typing.List[nikola.post.Post]', lang: str) -> bool:
"""Only generates Atom feed for list of posts for classification if this function returns True."""
return self.should_generate_classification_page(classification, post_list, lang)

def should_generate_rss_for_classification_page(self, classification: str, post_list: 'typing.List[nikola.post.Post]', lang: str) -> bool:
"""Only generates RSS feed for list of posts for classification if this function returns True."""
return self.should_generate_classification_page(classification, post_list, lang)
Expand Down
1 change: 0 additions & 1 deletion nikola/plugins/task/authors.py
Expand Up @@ -40,7 +40,6 @@ 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
2 changes: 1 addition & 1 deletion nikola/plugins/task/categories.py
Expand Up @@ -45,9 +45,9 @@ class ClassifyCategories(Taxonomy):
include_posts_from_subhierarchies = True
include_posts_into_hierarchy_root = False
show_list_as_subcategories_list = False
generate_atom_feeds_for_post_lists = True
template_for_classification_overview = "tags.tmpl"
always_disable_rss = False
always_disable_atom = False
apply_to_posts = True
apply_to_pages = False
minimum_post_count_per_classification_in_overview = 1
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/page_index.py
Expand Up @@ -41,10 +41,10 @@ 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_single_list = "list.tmpl"
template_for_classification_overview = None
always_disable_rss = True
always_disable_atom = True
apply_to_posts = False
apply_to_pages = True
omit_empty_classifications = True
Expand Down
3 changes: 1 addition & 2 deletions nikola/plugins/task/sections.py
Expand Up @@ -40,7 +40,6 @@ 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 All @@ -57,7 +56,7 @@ class ClassifySections(Taxonomy):
Example:
link://section_index_atom/cars => /cars/index.atom""",
link://section_index_atom/cars => /cars/feed.atom""",
'section_index_rss': """Link to the RSS feed for a section.
Example:
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/task/tags.py
Expand Up @@ -42,9 +42,9 @@ class ClassifyTags(Taxonomy):
more_than_one_classifications_per_post = True
has_hierarchy = False
show_list_as_subcategories_list = False
generate_atom_feeds_for_post_lists = True
template_for_classification_overview = "tags.tmpl"
always_disable_rss = False
always_disable_atom = False
apply_to_posts = True
apply_to_pages = False
omit_empty_classifications = True
Expand Down

0 comments on commit c21b788

Please sign in to comment.