<div class="layout_full block{{ class }}">

    <h1>{{ newsHeadline }}</h1>

    {% block info %}
        <p class="info"><time datetime="{{ datetime }}">{{ date }}</time> {{ author }}</p>
    {% endblock %}

    {% if hasSubHeadline %}
        <h2>{{ subHeadline }}</h2>
    {% endif %}

    {% if hasText.invoke() %}
        {{ text.invoke()|raw }}
    {% else %}
        <div class="ce_text content-text block">
            {% if not addBefore %}
                {{ teaser|default|sanitize_html('contao')|csp_inline_styles|insert_tag_raw }}
            {% endif %}

            {% if addImage %}
                {{ include('@Contao/image.html.twig') }}
            {% endif %}

            {% if addBefore %}
                {{ teaser|default|sanitize_html('contao')|csp_inline_styles|insert_tag_raw }}
            {% endif %}
        </div>
    {% endif %}

    {% if enclosure %}
        <ul class="enclosure">
            {% for enclosure in enclosure %}
                <li class="download-element ext-{{ enclosure.extension }}">
                    <a href="{{ enclosure.href }}" title="{{ enclosure.title }}">{{ enclosure.link }} <span class="size">({{ enclosure.filesize }})</span></a>
                </li>
            {% endfor %}
        </ul>
    {% endif %}

</div>

{% set schemaOrg = getSchemaOrgData.invoke() %}

{% if hasText.invoke() %}
    {% set schemaOrg = schemaOrg|merge({text: text.invoke()|html_to_plain_text}) %}
{% endif %}

{% do add_schema_org(schemaOrg) %}

{% if figure|default %}
    {% do add_schema_org({'@type': 'WebPage', primaryImageOfPage: figure.getSchemaOrgData()}) %}
{% endif %}
