diff options
Diffstat (limited to 'project/templates/tags.xhtml')
-rw-r--r-- | project/templates/tags.xhtml | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/project/templates/tags.xhtml b/project/templates/tags.xhtml new file mode 100644 index 0000000..42f3b5a --- /dev/null +++ b/project/templates/tags.xhtml @@ -0,0 +1,34 @@ + +{%- extends "base.xhtml" -%} + + + +{%- 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 = { 'value': 0 } -%} + {%- for item in articles -%} + {%- if tag in item.taglist -%} + {%- if total.update({'value': total.value + 1}) -%}{%- endif -%} + {%- endif -%} + {%- if item == articles | last %} + <li><a href="/tags/{{ tag }}.xhtml">{{ tag }} ({{ total.value }})</a></li> + {%- endif -%} + {%- endfor -%} + {%- endfor %} +</ul> +{% endblock -%} + + |