Use *.slug instead of category/feed as latter includes relative URL.
The page_name variable includes relative path to the actual page_name
so it won't necessary match the feed file name if they are not in
the same path.
The category.slug and tag.slug variables instead are just a
shorthand for slugified category/tag name, which is what we need.
diff --git a/templates/category.html b/templates/category.html
index a3b4dc1..753d990 100644
--- a/templates/category.html
+++ b/templates/category.html
@@ -3,19 +3,19 @@
{% block head %}
{% if CATEGORY_FEED_ATOM %}
-<link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM|format(category) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} {{ category }} Category Atom Feed" />
+<link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM|format(category.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} {{ category }} Category Atom Feed" />
{% endif %}
{% if CATEGORY_FEED_RSS %}
-<link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS|format(category) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} {{ category }} Category RSS Feed" />
+<link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS|format(category.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} {{ category }} Category RSS Feed" />
{% endif %}
{% endblock %}
{% block subheader %}
<p>Category: {{ category }}
{% if CATEGORY_FEED_ATOM %}
-| <a href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM|format(category) }}">Atom Feed</a>
+| <a href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM|format(category.slug) }}">Atom Feed</a>
{% endif %}
{% if CATEGORY_FEED_RSS %}
-| <a href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS|format(category) }}">RSS Feed</a>
+| <a href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS|format(category.slug) }}">RSS Feed</a>
{% endif %}</p>
{% endblock %}
diff --git a/templates/tag.html b/templates/tag.html
index 2c5b49c..7261e5c 100644
--- a/templates/tag.html
+++ b/templates/tag.html
@@ -3,19 +3,19 @@
{% block head %}
{% if TAG_FEED_ATOM %}
-<link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM|format(tag) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} {{ tag }} Tag Atom Feed" />
+<link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM|format(tag.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} {{ tag }} Tag Atom Feed" />
{% endif %}
{% if TAG_FEED_RSS %}
-<link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(tag) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} {{ tag }} Tag RSS Feed" />
+<link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(tag.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} {{ tag }} Tag RSS Feed" />
{% endif %}
{% endblock %}
{% block subheader %}
<p>Tag: {{ tag }}
{% if TAG_FEED_ATOM %}
-| <a href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM|format(tag) }}">Atom Feed</a>
+| <a href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM|format(tag.slug) }}">Atom Feed</a>
{% endif %}
{% if TAG_FEED_RSS %}
-| <a href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(tag) }}">RSS Feed</a>
+| <a href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(tag.slug) }}">RSS Feed</a>
{% endif %}</p>
{% endblock %}