Browse Source

Tags and categories feeds appear on Tags and Categories pages only

Fix #13
Talha Mansoor 11 years ago
parent
commit
da1ee2bdfa

+ 2 - 0
templates/base.html

@@ -37,7 +37,9 @@
         <link rel="apple-touch-icon" sizes="114x114" href="{{ SITEURL }}/theme/images/apple-touch-icon-114x114.png" />
         <link rel="apple-touch-icon" sizes="114x114" href="{{ SITEURL }}/theme/images/apple-touch-icon-114x114.png" />
         <link rel="apple-touch-icon" sizes="144x144" href="{{ SITEURL }}/theme/images/apple-touch-icon-144x144.png" />
         <link rel="apple-touch-icon" sizes="144x144" href="{{ SITEURL }}/theme/images/apple-touch-icon-144x144.png" />
         <link rel="icon" href="{{ SITEURL }}/theme/images/apple-touch-icon-144x144.png" />
         <link rel="icon" href="{{ SITEURL }}/theme/images/apple-touch-icon-144x144.png" />
+        {% block feed_links %}
         {% include 'feeds.html' %}
         {% include 'feeds.html' %}
+        {% endblock feed_links %}
         {% include 'analytics.html' %}
         {% include 'analytics.html' %}
     </head>
     </head>
     <body>
     <body>

+ 6 - 0
templates/categories.html

@@ -7,6 +7,12 @@ All Categories · {{ super() }}
 {% block head_description %}
 {% block head_description %}
 All categories of the {{ SITENAME|striptags }} blog. 
 All categories of the {{ SITENAME|striptags }} blog. 
 {% endblock head_description %}
 {% endblock head_description %}
+
+{% block feed_links %}
+{{ super() }}
+{% include 'feeds_categories.html' %}
+{% endblock feed_links %}
+
 {% block content %}
 {% block content %}
 <div class="row-fluid">
 <div class="row-fluid">
     <header class="page_header span10 offset2">
     <header class="page_header span10 offset2">

+ 1 - 24
templates/feeds.html

@@ -10,27 +10,4 @@
 {% if FEED_RSS %}
 {% if FEED_RSS %}
         <link href="{{ FEED_DOMAIN }}/{{ FEED_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} - RSS Feed" />
         <link href="{{ FEED_DOMAIN }}/{{ FEED_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} - RSS Feed" />
 {% endif %}
 {% endif %}
-{% if CATEGORY_FEED_ATOM %}
-    {% for category in categories %}
-    {% set cat_name = category[0]|replace(' ', '-') %}
-        <link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM|format(cat_name) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} - {{category[0]}} Category Atom Feed" />
-    {% endfor %}
-{% endif %}
-{% if CATEGORY_FEED_RSS %}
-    {% for category in categories %}
-    {% set cat_name = category[0]|replace(' ', '-') %}
-        <link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS|format(cat_name) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} - {{category[0]}} Category RSS Feed" />
-    {% endfor %}
-{% endif %}
-{% if TAG_FEED_ATOM %}
-    {% for tag in tags %}
-    {% set tag_name = tag[0]|replace(' ', '-') %}
-        <link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM|format(tag_name) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} - {{tag[0]}} Tag Atom Feed" />
-    {% endfor %}
-{% endif %}
-{% if TAG_FEED_RSS %}
-    {% for tag in tags %}
-    {% set tag_name = tag[0]|replace(' ', '-') %}
-        <link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(tag_name) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} - {{tag[0]}} Tag RSS Feed" />
-    {% endfor %}
-{% endif %}
+

+ 13 - 0
templates/feeds_categories.html

@@ -0,0 +1,13 @@
+{% if CATEGORY_FEED_ATOM %}
+    {% for category in categories %}
+    {% set cat_name = category[0]|replace(' ', '-') %}
+        <link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM|format(cat_name) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} - {{category[0]}} Category Atom Feed" />
+    {% endfor %}
+{% endif %}
+{% if CATEGORY_FEED_RSS %}
+    {% for category in categories %}
+    {% set cat_name = category[0]|replace(' ', '-') %}
+        <link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS|format(cat_name) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} - {{category[0]}} Category RSS Feed" />
+    {% endfor %}
+{% endif %}
+

+ 12 - 0
templates/feeds_tags.html

@@ -0,0 +1,12 @@
+{% if TAG_FEED_ATOM %}
+    {% for tag in tags %}
+    {% set tag_name = tag[0]|replace(' ', '-') %}
+        <link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM|format(tag_name) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} - {{tag[0]}} Tag Atom Feed" />
+    {% endfor %}
+{% endif %}
+{% if TAG_FEED_RSS %}
+    {% for tag in tags %}
+    {% set tag_name = tag[0]|replace(' ', '-') %}
+        <link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(tag_name) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} - {{tag[0]}} Tag RSS Feed" />
+    {% endfor %}
+{% endif %}

+ 6 - 0
templates/tags.html

@@ -7,6 +7,12 @@ All Tags · {{ super() }}
 {% block head_description %}
 {% block head_description %}
 All tags used in the {{ SITENAME|striptags }} blog.
 All tags used in the {{ SITENAME|striptags }} blog.
 {% endblock head_description %}
 {% endblock head_description %}
+
+{% block feed_links %}
+{{ super() }}
+{% include 'feeds_tags.html' %}
+{% endblock feed_links %}
+
 {% block content %}
 {% block content %}
 
 
 <div class="row-fluid">
 <div class="row-fluid">