@extends('layouts.frontend')

@section('ogp')
    <meta property="og:type" content="website">
    <meta property="og:url" content="{{ url($page->post->slug) }}">
    <meta property="og:image" content="{{ url($options->image ?? 'images/image.jpg') }}">
    <meta property="og:title" content="{{ isHome() ? $options->title : $page->post->title }}">
    <meta property="og:description" content="{{ $page->post->excerpt }}">
@endsection

@section('title', isHome() ? options('tag') : $page->post->title)

@if(view()->exists('templates.'.$page->template))
    @include('templates.'.$page->template)
@else

@section('content')
    <article class="page">
        <div class="breadcrumb">
            <div class="container d-flex align-items-center">
                <a href="{{ url('/') }}">Inicio</a>
                <span>@yield('title')</span>
            </div>
        </div>
        <section>
            <div class="container">
                @if($section = $page->sections->first())
                    <h2 mb-3>{{ $section->post->title }}</h2>
                    <div class="content-html">
                        {!! $section->post->content !!}
                    </div>
                @endif
            </div>
        </section>
    </article>
@endsection
@endif