Skip to content
Permalink
Browse files

Fixed confusion about rss_link.

  • Loading branch information
felixfontein committed Oct 20, 2016
1 parent 7b4d25c commit 3d40b402af254ce082c8f30f8331eada57b71baf
@@ -651,8 +651,7 @@ def provide_context_and_uptodate(self, classification, lang):
Must return a tuple of two dicts. The first is merged into the page's context,
the second will be put into the uptodate list of all generated tasks.
Context must contain `title`, which should be something like 'Posts about <classification>',
and `classification_title`, which should be related to the classification string.
Context must contain `title`, which should be something like 'Posts about <classification>'.
"""
raise NotImplementedError()

@@ -156,7 +156,6 @@ def provide_context_and_uptodate(self, classification, lang):
raise Exception("Cannot interpret classification {}!".format(repr(classification)))
context = {
"title": title,
"classification_title": classification,
"pagekind": [page_kind, "archive_page"],
}
if page_kind == 'index':
@@ -107,10 +107,13 @@ def provide_context_and_uptodate(self, author, lang):
context = {
"author": author,
"title": kw["messages"][lang]["Posts by %s"] % author,
"classification_title": author,
"description": descriptions[lang][author] if lang in descriptions and author in descriptions[lang] else None,
"pagekind": ["index" if self.show_list_as_index else "list", "author_page"],
}
if self.site.config["GENERATE_RSS"]:
rss_link = ("""<link rel="alternate" type="application/rss+xml" title="RSS for author {0} ({1})" href="{2}">""".format(
author, lang, self.site.link('author_rss', classification, lang)))
context['rss_link'] = rss_link
kw.update(context)
return context, kw

@@ -87,7 +87,6 @@ def provide_context_and_uptodate(self, classification, lang):
}
context = {
"title": self.site.config["INDEXES_TITLE"](lang) or self.site.config["BLOG_TITLE"](lang),
"classification_title": "",
"description": self.site.config["BLOG_DESCRIPTION"](lang),
"pagekind": ["main_index", "index"],
}
@@ -89,7 +89,6 @@ def provide_context_and_uptodate(self, dirname, lang):
}
context = {
"title": self.site.config['BLOG_TITLE'](lang),
"classification_title": self.site.config['BLOG_TITLE'](lang),
"pagekind": ["list", "front_page"] if dirname == '' else ["list"],
}
kw.update(context)
@@ -83,14 +83,7 @@ def get_path(self, section, lang, type='page'):
return [_f for _f in [self.site.config['TRANSLATIONS'][lang], section] if _f], 'always'

def provide_context_and_uptodate(self, section, lang):
"""Provide data for the context and the uptodate list for the list of the given classifiation.
Must return a tuple of two dicts. The first is merged into the page's context,
the second will be put into the uptodate list of all generated tasks.
Context must contain `title`, which should be something like 'Posts about <classification>',
and `classification_title`, which should be related to the classification string.
"""
"""Provide data for the context and the uptodate list for the list of the given classifiation."""
kw = {
"messages": self.site.MESSAGES,
}
@@ -107,7 +100,6 @@ def provide_context_and_uptodate(self, section, lang):
# Compose context
context = {
"title": section_title,
"classification_title": section_name,
"description": self.site.config['POSTS_SECTION_DESCRIPTIONS'](lang)[section] if section in self.site.config['POSTS_SECTION_DESCRIPTIONS'](lang) else "",
"pagekind": ["section_page", "index" if self.show_list_as_index else "list"]
}
@@ -157,10 +157,6 @@ def page_path(i, displayed_i, num_pages, force_addition, extension=None):
return utils.adjust_name_for_index_path(self.site.path(feed.format(kind), classification, lang), i, displayed_i, lang, self.site, force_addition, extension)

context = copy(context)
if kw["generate_rss"] and not taxonomy.always_disable_rss:
rss_link = ("""<link rel="alternate" type="application/rss+xml" title="RSS for {0} {1} ({2})" href="{3}">""".format(
taxonomy.classification_name, context['classification_title'], lang, self.site.link('{}_rss'.format(kind), classification, lang)))
context['rss_link'] = rss_link
if "pagekind" not in context:
context["pagekind"] = ["index", "tag_page"]
template_name = taxonomy.template_for_list_of_one_classification

0 comments on commit 3d40b40

Please sign in to comment.