Open iranzo opened 5 years ago
{% if CATEGORY_FEED_ATOM and category %}
<link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM|format(slug=category.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Categories Atom Feed" />
{% endif %}
{% if CATEGORY_FEED_RSS and category %}
<link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS|format(slug=category.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Categories RSS Feed" />
{% endif %}
{% if TAG_FEED_ATOM and tag %}
<link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM|format(slug=tag.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Tags Atom Feed" />
{% endif %}
{% if TAG_FEED_RSS and tag %}
<link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(slug=tag.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Tags RSS Feed" />
{% endif %}
For example, substitute TAG_FEED_ATOM|format(tag.slug) with TAG_FEED_ATOM.format(slug=tag.slug).
That being said, this does not work for me. I get CRITICAL: UndefinedError: 'tag' is undefined
error.
I'm using pelican 4 and it renders properly:
themes/nest/templates/base.html: {% if TAG_FEED_ATOM and tag %}
themes/nest/templates/base.html: <link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM|format(slug=tag.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Tags Atom Feed" />
themes/nest/templates/base.html: {% if TAG_FEED_RSS and tag %}
themes/nest/templates/base.html: <link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(slug=tag.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Tags RSS Feed" />
No doubt I'm doing something wrong. I'll try your approach.
Hi, With Pelican 4, templates/base will traceback because new format requires:
format(slug=$PREVIOUSTEXT) for both categories and tags rss/atom feed
Regards, Pablo