Enable some metatags to be comma-separated lists
This commit is contained in:
@ -15,6 +15,10 @@ SUPPORTED_METATAGS = {
|
|||||||
'excerpt': u'',
|
'excerpt': u'',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LIST_METATAGS = [
|
||||||
|
'category',
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
# Blog helper methods
|
# Blog helper methods
|
||||||
@ -105,4 +109,6 @@ def get_metadata_from_meta(meta):
|
|||||||
for metaTag in SUPPORTED_METATAGS:
|
for metaTag in SUPPORTED_METATAGS:
|
||||||
metaLine = [s for s in metaLines if 'name="%s"' % metaTag in s]
|
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]
|
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
|
return ret
|
||||||
|
Reference in New Issue
Block a user