{% extends "layout.html" %}
{%- macro strip_meta(html, name) %}
{%- set text = html|
replace('name="' + name + '"', '')|
replace('content=', '')|
replace('', '')|
replace('"', '')|trim
-%}
{{ text }}
{%- endmacro %}
{%- macro og_meta() %}
{%- for html in metatags.split('\n') %}
{%- if 'name="description"' in html %}
{%- set text = strip_meta(html, 'description')|trim %}
{%- elif 'name="image"' in html %}
{%- set src = strip_meta(html, 'image')|trim %}
{%- endif %}
{%- endfor %}
{%- endmacro %}
{% block extrahead %}
{%- if theme_description and 'name="description"' not in metatags %}
{%- else %}
{{- og_meta() }}
{%- endif %}
{%- if theme_og_image and 'name="image"' not in metatags %}
{%- endif %}
{%- if theme_twitter %}
{%- endif -%}
{% endblock %}
{% block body %}
{{ body }}
{% endblock %}