Просмотр исходного кода

Shows all the tags and articles in the tags page

Talha Mansoor лет назад: 11
Родитель
Сommit
85375c7185
2 измененных файлов с 16 добавлено и 2 удалено
  1. 1 1
      templates/article.html
  2. 15 1
      templates/tags.html

+ 1 - 1
templates/article.html

@@ -56,7 +56,7 @@
                 <p>Tags:
                 <ul> 
                     {% for tag in article.tags %}
-                    <li><a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}
+                    <li><a href="/tags.html#{{ tag|replace(' ', '-')|e }}-ref">{{ tag }}
                         {% for aTag, tagged_articles in tags if aTag == tag %}
                         {{ tagged_articles|count }}
                         {% endfor %}</a></li>

+ 15 - 1
templates/tags.html

@@ -63,11 +63,25 @@ All Tags - {{ super() }}
             {% for tag, articles in tags %}
             <li>
             {% set num = articles|count %}
-            <a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}<span>{{ num }}</span></a>
+            <a href="/tags.html#{{ tag|replace(' ', '-')|e }}-ref">{{ tag }}<span>{{ num }}</span></a>
             </li>
             {% endfor %}
         </ul>
     </div>
 </div>
 
+<div class="row-fluid">
+    <div class="span7 offset3">
+        {% for tag, articles in tags %}
+        <h2 id="{{ tag|replace(' ', '-')|e }}-ref">{{ tag }}</h2>
+        <ul>
+            {% for article in articles %} 
+            <li><a href="{{ article.url }}">{{ article.title }}</a></li>
+            {% endfor %}
+        </ul>
+
+        {% endfor %}
+    </div>
+</div>
+
 {% endblock content %}