From 786e37f524ea15cc1ea2f18fa1f529924fc4d495 Mon Sep 17 00:00:00 2001 From: str4d Date: Wed, 16 Jan 2013 02:03:21 +0000 Subject: [PATCH] Enable some metatags to be comma-separated lists --- i2p2www/blog/helpers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/i2p2www/blog/helpers.py b/i2p2www/blog/helpers.py index 8ffadb85..d4c12884 100644 --- a/i2p2www/blog/helpers.py +++ b/i2p2www/blog/helpers.py @@ -15,6 +15,10 @@ SUPPORTED_METATAGS = { 'excerpt': u'', } +LIST_METATAGS = [ + 'category', + ] + ##################### # Blog helper methods @@ -105,4 +109,6 @@ def get_metadata_from_meta(meta): for metaTag in SUPPORTED_METATAGS: metaLine = [s for s in metaLines if 'name="%s"' % metaTag in s] ret[metaTag] = metaLine[0].split('content="')[1].split('"')[0] if len(metaLine) > 0 else SUPPORTED_METATAGS[metaTag] + if metaTag in LIST_METATAGS: + ret[metaTag] = [s.strip() for s in ret[metaTag].split(',')] return ret