Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c21b788

Browse files
committedMay 1, 2018
Split Atom generation out of index generation
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent ecedddd commit c21b788

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed
 

‎nikola/plugin_categories.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -643,18 +643,18 @@ class Taxonomy(BasePlugin):
643643
The template to use for the subcategories list when
644644
show_list_as_subcategories_list is True.
645645
646-
generate_atom_feeds_for_post_lists = False:
647-
Whether to generate Atom feeds for post lists in case GENERATE_ATOM is set.
648-
649646
template_for_single_list = "tagindex.tmpl":
650647
The template to use for the post list for one classification.
651648
652649
template_for_classification_overview = "list.tmpl":
653650
The template to use for the classification overview page.
654651
Set to None to avoid generating overviews.
655652
653+
always_disable_atom = False:
654+
Whether to always disable Atom feed generation.
655+
656656
always_disable_rss = False:
657-
Whether to always disable RSS feed generation
657+
Whether to always disable RSS feed generation.
658658
659659
apply_to_posts = True:
660660
Whether this classification applies to posts.
@@ -698,9 +698,9 @@ class Taxonomy(BasePlugin):
698698
show_list_as_subcategories_list = False
699699
show_list_as_index = False
700700
subcategories_list_template = "taxonomy_list.tmpl"
701-
generate_atom_feeds_for_post_lists = False
702701
template_for_single_list = "tagindex.tmpl"
703702
template_for_classification_overview = "list.tmpl"
703+
always_disable_atom = False
704704
always_disable_rss = False
705705
apply_to_posts = True
706706
apply_to_pages = False
@@ -860,6 +860,10 @@ def should_generate_classification_page(self, classification: str, post_list: 't
860860
"""Only generates list of posts for classification if this function returns True."""
861861
return True
862862

863+
def should_generate_atom_for_classification_page(self, classification: str, post_list: 'typing.List[nikola.post.Post]', lang: str) -> bool:
864+
"""Only generates Atom feed for list of posts for classification if this function returns True."""
865+
return self.should_generate_classification_page(classification, post_list, lang)
866+
863867
def should_generate_rss_for_classification_page(self, classification: str, post_list: 'typing.List[nikola.post.Post]', lang: str) -> bool:
864868
"""Only generates RSS feed for list of posts for classification if this function returns True."""
865869
return self.should_generate_classification_page(classification, post_list, lang)

‎nikola/plugins/task/authors.py

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class ClassifyAuthors(Taxonomy):
4040
overview_page_variable_name = "authors"
4141
more_than_one_classifications_per_post = False
4242
has_hierarchy = False
43-
generate_atom_feeds_for_post_lists = False
4443
template_for_classification_overview = "authors.tmpl"
4544
apply_to_posts = True
4645
apply_to_pages = False

‎nikola/plugins/task/categories.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ class ClassifyCategories(Taxonomy):
4545
include_posts_from_subhierarchies = True
4646
include_posts_into_hierarchy_root = False
4747
show_list_as_subcategories_list = False
48-
generate_atom_feeds_for_post_lists = True
4948
template_for_classification_overview = "tags.tmpl"
5049
always_disable_rss = False
50+
always_disable_atom = False
5151
apply_to_posts = True
5252
apply_to_pages = False
5353
minimum_post_count_per_classification_in_overview = 1

‎nikola/plugins/task/page_index.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ class PageIndex(Taxonomy):
4141
has_hierarchy = True
4242
include_posts_from_subhierarchies = False
4343
show_list_as_index = False
44-
generate_atom_feeds_for_post_lists = False
4544
template_for_single_list = "list.tmpl"
4645
template_for_classification_overview = None
4746
always_disable_rss = True
47+
always_disable_atom = True
4848
apply_to_posts = False
4949
apply_to_pages = True
5050
omit_empty_classifications = True

‎nikola/plugins/task/sections.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class ClassifySections(Taxonomy):
4040
overview_page_variable_name = "sections"
4141
more_than_one_classifications_per_post = False
4242
has_hierarchy = False
43-
generate_atom_feeds_for_post_lists = False
4443
template_for_classification_overview = None
4544
apply_to_posts = True
4645
apply_to_pages = False
@@ -57,7 +56,7 @@ class ClassifySections(Taxonomy):
5756
5857
Example:
5958
60-
link://section_index_atom/cars => /cars/index.atom""",
59+
link://section_index_atom/cars => /cars/feed.atom""",
6160
'section_index_rss': """Link to the RSS feed for a section.
6261
6362
Example:

‎nikola/plugins/task/tags.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ class ClassifyTags(Taxonomy):
4242
more_than_one_classifications_per_post = True
4343
has_hierarchy = False
4444
show_list_as_subcategories_list = False
45-
generate_atom_feeds_for_post_lists = True
4645
template_for_classification_overview = "tags.tmpl"
4746
always_disable_rss = False
47+
always_disable_atom = False
4848
apply_to_posts = True
4949
apply_to_pages = False
5050
omit_empty_classifications = True

0 commit comments

Comments
 (0)
Please sign in to comment.