diff options
Diffstat (limited to 'project/templates/tags.html')
-rw-r--r-- | project/templates/tags.html | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/project/templates/tags.html b/project/templates/tags.html index a3edfcc..349f575 100644 --- a/project/templates/tags.html +++ b/project/templates/tags.html @@ -8,7 +8,7 @@ {% block style %} - <link href="/css/tags.css" rel="stylesheet"> + <link href="/css/tags.css" rel="stylesheet" /> {% endblock %} @@ -19,11 +19,13 @@ <ul> {%- for tag in tags -%} - {%- set total = 0 -%} + {%- set total = { 'value': 0 } -%} {%- for item in articles -%} - {%- if tag in item.taglist -%}{%- set total = total + 1 -%}{%- endif -%} + {%- if tag in item.taglist -%} + {%- if total.update({'value': total.value + 1}) -%}{%- endif -%} + {%- endif -%} {%- if item == articles | last %} - <li><a href="/tags/{{ tag }}.html">{{ tag }} ({{ total }})</a></li> + <li><a href="/tags/{{ tag }}.html">{{ tag }} ({{ total.value }})</a></li> {%- endif -%} {%- endfor -%} {%- endfor %} |