Commit 0ce84f88 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt Committed by Robert

allow meta tags to be set as properties. refs #395

parent 44e002ef
...@@ -192,13 +192,15 @@ class StyleInline(StyleAsset): ...@@ -192,13 +192,15 @@ class StyleInline(StyleAsset):
class Meta(Asset): class Meta(Asset):
def __init__(self, name, content): def __init__(self, name, content, is_property=False):
super().__init__(stage='early') super().__init__(stage='early') = name = name
self.content = content self.content = content
self.is_property = is_property
def create_tag(self): def create_tag(self):
return '<meta name="{name}" content="{content}">'.format( return '<meta {key}="{name}" content="{content}">'.format(
key='property' if self.is_property else 'name',, content=self.content, content=self.content
) )
...@@ -231,8 +233,8 @@ def add_link(href, rel, **attributes): ...@@ -231,8 +233,8 @@ def add_link(href, rel, **attributes):
_ASSETS.append(Link(href, rel, **attributes)) _ASSETS.append(Link(href, rel, **attributes))
def add_meta(name, content): def add_meta(name, content, is_property=False):
_ASSETS.append(Meta(name, content)) _ASSETS.append(Meta(name, content, is_property))
def get_assets(stage): def get_assets(stage):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment