{% load static wagtailuserbar %} {% load wagtailcore_tags %} {% load static %} {% load wagtailimages_tags %}
{# Meta descrição tradicional ANTES das tags Open Graph #} {% if page.legenda_home %} {% elif page.subtitulo %} {% elif page.search_description %} {% else %} {% endif %} {# Open Graph - ORDEM CORRETA #} {# Descrição Open Graph #} {% if page.legenda_home %} {% elif page.subtitulo %} {% elif page.search_description %} {% else %} {% endif %} {# IMAGEM OPEN GRAPH - ESPECÍFICO PARA ENAPNoticia #} {% if page.imagem_externa %} {# Prioridade 1: imagem_externa (para compartilhamento) #} {% image page.imagem_externa fill-1200x630 as og_image %} {% elif page.featured_image %} {# Prioridade 2: featured_image (StreamField) - usando primeira imagem #} {% with first_block=page.featured_image.0 %} {% if first_block.block_type == "image" and first_block.value.image %} {% image first_block.value.image fill-1200x630 as og_image %} {% endif %} {% endwith %} {% elif page.image %} {# Prioridade 3: campo image genérico (se existir) #} {% with page.image.0.value as first_image %} {% image first_image fill-1200x630 as og_image %} {% endwith %} {% else %} {# Fallback: Imagem padrão ENAP #} {% endif %} {# Meta tags específicas para artigos #} {% if page.date_display %} {% elif page.first_published_at %} {% endif %} {% if page.author %} {% elif page.author_display %} {% endif %} {# Twitter Cards #} {% if page.legenda_home %} {% elif page.subtitulo %} {% elif page.search_description %} {% else %} {% endif %} {% block metadata %}{% endblock %} {% block title %}