diff options
Diffstat (limited to 'project/templates/tags.html')
-rw-r--r-- | project/templates/tags.html | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/project/templates/tags.html b/project/templates/tags.html new file mode 100644 index 0000000..a3edfcc --- /dev/null +++ b/project/templates/tags.html @@ -0,0 +1,34 @@ + +{% extends "base.html" %} + + + +{% block title %}Tags{% endblock %} + + + +{% block style %} + <link href="/css/tags.css" rel="stylesheet"> +{% endblock %} + + + +{% block content %} + +<h4>Tags</h4> + +<ul> + {%- for tag in tags -%} + {%- set total = 0 -%} + {%- for item in articles -%} + {%- if tag in item.taglist -%}{%- set total = total + 1 -%}{%- endif -%} + {%- if item == articles | last %} + <li><a href="/tags/{{ tag }}.html">{{ tag }} ({{ total }})</a></li> + {%- endif -%} + {%- endfor -%} + {%- endfor %} +</ul> + +{% endblock %} + + |