mirror of
https://github.com/vale981/ablog
synced 2025-03-05 09:11:38 -05:00
Revised feed linking for archives (#54).
This commit is contained in:
parent
9d60b5116e
commit
566884d8eb
3 changed files with 9 additions and 6 deletions
|
@ -34,8 +34,13 @@ def builder_support(builder):
|
|||
def html_page_context(app, pagename, templatename, context, doctree):
|
||||
|
||||
if builder_support(app):
|
||||
context['ablog'] = Blog(app)
|
||||
context['ablog'] = blog = Blog(app)
|
||||
context['anchor'] = anchor
|
||||
# following is already available for archive pages
|
||||
if blog.blog_baseurl and 'feed_path' not in context:
|
||||
context['feed_path'] = blog.blog_path
|
||||
context['feed_title'] = blog.blog_title
|
||||
|
||||
|
||||
|
||||
def setup(app):
|
||||
|
|
|
@ -510,8 +510,6 @@ def generate_archive_pages(app):
|
|||
'header': header,
|
||||
'catalog': catalog,
|
||||
'summary': True,
|
||||
'atom_feed': atom_feed,
|
||||
'feed_path': blog_path,
|
||||
}
|
||||
yield (catalog.docname, context, 'catalog.html')
|
||||
|
||||
|
@ -525,10 +523,10 @@ def generate_archive_pages(app):
|
|||
'header': header,
|
||||
'collection': collection,
|
||||
'summary': True,
|
||||
'atom_feed': atom_feed,
|
||||
'feed_path': collection.path if feed_archives else blog_path,
|
||||
'archive_feed': atom_feed and feed_archives
|
||||
}
|
||||
context['feed_title'] = context['title']
|
||||
yield (collection.docname, context, 'collection.html')
|
||||
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
{% set fa = ablog.fontawesome %}
|
||||
{%- block extrahead %}
|
||||
{{ super() }}
|
||||
{% if ablog.blog_baseurl %}
|
||||
<link rel="alternate" type="application/atom+xml" href="{{ pathto(ablog.blog_path, 1) }}/atom.xml" title="{{ ablog.blog_title }}">
|
||||
{% if feed_path %}
|
||||
<link rel="alternate" type="application/atom+xml" href="{{ pathto(feed_path, 1) }}/atom.xml" title="{{ feed_title }}">
|
||||
{% endif %}
|
||||
{% if ablog.fontawesome_link_cdn%}
|
||||
<link href="{{ ablog.fontawesome_link_cdn }}" rel="stylesheet">
|
||||
|
|
Loading…
Add table
Reference in a new issue