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):
|
def html_page_context(app, pagename, templatename, context, doctree):
|
||||||
|
|
||||||
if builder_support(app):
|
if builder_support(app):
|
||||||
context['ablog'] = Blog(app)
|
context['ablog'] = blog = Blog(app)
|
||||||
context['anchor'] = anchor
|
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):
|
def setup(app):
|
||||||
|
|
|
@ -510,8 +510,6 @@ def generate_archive_pages(app):
|
||||||
'header': header,
|
'header': header,
|
||||||
'catalog': catalog,
|
'catalog': catalog,
|
||||||
'summary': True,
|
'summary': True,
|
||||||
'atom_feed': atom_feed,
|
|
||||||
'feed_path': blog_path,
|
|
||||||
}
|
}
|
||||||
yield (catalog.docname, context, 'catalog.html')
|
yield (catalog.docname, context, 'catalog.html')
|
||||||
|
|
||||||
|
@ -525,10 +523,10 @@ def generate_archive_pages(app):
|
||||||
'header': header,
|
'header': header,
|
||||||
'collection': collection,
|
'collection': collection,
|
||||||
'summary': True,
|
'summary': True,
|
||||||
'atom_feed': atom_feed,
|
|
||||||
'feed_path': collection.path if feed_archives else blog_path,
|
'feed_path': collection.path if feed_archives else blog_path,
|
||||||
'archive_feed': atom_feed and feed_archives
|
'archive_feed': atom_feed and feed_archives
|
||||||
}
|
}
|
||||||
|
context['feed_title'] = context['title']
|
||||||
yield (collection.docname, context, 'collection.html')
|
yield (collection.docname, context, 'collection.html')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
{% set fa = ablog.fontawesome %}
|
{% set fa = ablog.fontawesome %}
|
||||||
{%- block extrahead %}
|
{%- block extrahead %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
{% if ablog.blog_baseurl %}
|
{% if feed_path %}
|
||||||
<link rel="alternate" type="application/atom+xml" href="{{ pathto(ablog.blog_path, 1) }}/atom.xml" title="{{ ablog.blog_title }}">
|
<link rel="alternate" type="application/atom+xml" href="{{ pathto(feed_path, 1) }}/atom.xml" title="{{ feed_title }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if ablog.fontawesome_link_cdn%}
|
{% if ablog.fontawesome_link_cdn%}
|
||||||
<link href="{{ ablog.fontawesome_link_cdn }}" rel="stylesheet">
|
<link href="{{ ablog.fontawesome_link_cdn }}" rel="stylesheet">
|
||||||
|
|
Loading…
Add table
Reference in a new issue