From 508c6f1e8074527f01047ea6f40c3115d7191e1f Mon Sep 17 00:00:00 2001 From: str4d Date: Sun, 3 Feb 2013 01:40:47 +0000 Subject: [PATCH] Render categories properly --- i2p2www/pages/blog/post.html | 3 ++- i2p2www/pages/global/macros | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/i2p2www/pages/blog/post.html b/i2p2www/pages/blog/post.html index 22ed3c3d..07b7de72 100644 --- a/i2p2www/pages/blog/post.html +++ b/i2p2www/pages/blog/post.html @@ -1,10 +1,11 @@ {% extends "global/layout.html" %} +{%- from "global/macros" import render_categories with context -%} {% block title %}{{ title }} - {{ _('Blog') }}{% endblock %} {% block content %} {% autoescape false %} {{ body }} diff --git a/i2p2www/pages/global/macros b/i2p2www/pages/global/macros index 756ddf75..2bd426c9 100644 --- a/i2p2www/pages/global/macros +++ b/i2p2www/pages/global/macros @@ -31,3 +31,10 @@ {%- endif %} {%- endmacro -%} + +{%- macro render_categories(categories) -%} +{%- if categories and categories|length %} +{%- for category in categories %}{{ category }}{% if not loop.last %}, {% endif %}{% endfor %} +{%- else %}{{ _('None') }} +{%- endif %} +{%- endmacro %}