Added Schema.org meta header class
authorThierry Florac <tflorac@ulthar.net>
Wed, 16 Jan 2019 19:13:01 +0100
changeset 507 1c7bd4ccfb32
parent 506 08196fe15f4a
child 508 eb708d0e9298
Added Schema.org meta header class
src/pyams_skin/metas.py
--- a/src/pyams_skin/metas.py	Wed Jan 16 11:56:44 2019 +0100
+++ b/src/pyams_skin/metas.py	Wed Jan 16 19:13:01 2019 +0100
@@ -116,6 +116,19 @@
 
 
 @implementer(IMetaHeader)
+class SchemaMeta(object):
+    """Schema.org property meta header"""
+
+    def __init__(self, name, value):
+        self.name = name
+        self.value = value
+
+    def render(self):
+        return '''<meta itemprop="{name}" content="{value}" />'''.format(name=self.name,
+                                                                         value=self.value)
+
+
+@implementer(IMetaHeader)
 class LinkMeta(object):
     """Link meta header"""