@extends('theme::layouts.web')

@section('title', $page->getTitle())
@section('description', $page->getTranslation('excerpt', $currentLocale) ?: '')

@section('content')
<main class="container py-5">
    <x-microdata::attributes :for="$page" tag="article" class="cms-page">
        <header class="mb-4">
            <h1 class="mb-2">
                <x-microdata::property name="headline" :for="$page" :value="$page->getTitle()" />
            </h1>

            @if ($page->getTranslation('excerpt', $currentLocale))
                <p class="lead text-muted mb-0">
                    <x-microdata::property
                        name="description"
                        :for="$page"
                        :value="$page->getTranslation('excerpt', $currentLocale)" />
                </p>
            @endif

            @if ($page->published_at)
                <x-microdata::property
                    name="datePublished"
                    :for="$page"
                    :value="$page->published_at->toIso8601String()"
                    tag="meta"
                    content-attr="content" />
            @endif
        </header>

        <x-microdata::property name="articleBody" :for="$page" tag="div" class="cms-page-content">
            {!! $page->renderContent($currentLocale) !!}
        </x-microdata::property>
    </x-microdata::attributes>
</main>
@endsection
