@props([ 'title' => null, // page title; site name is appended automatically 'description' => null, // falls back to the translated default 'image' => null, // OG/Twitter image (absolute URL or public path) 'type' => 'website', // og:type — 'website' | 'article' 'canonical' => null, // defaults to the current URL 'noindex' => false, // true on private/utility pages 'organization' => false, // emit Organization JSON-LD (use on the home page) ]) @php $siteName = config('seo.site_name', 'Fermenty'); $sep = config('seo.title_separator', '·'); $fullTitle = $title ? trim($title) . ' ' . $sep . ' ' . $siteName : __('seo.default_title'); $desc = trim((string) ($description ?: __('seo.default_description'))); // Resolve the social image to an absolute URL. $rawImage = $image ?: config('seo.default_image'); $imageUrl = \Illuminate\Support\Str::startsWith($rawImage, ['http://', 'https://']) ? $rawImage : url($rawImage); $canonicalUrl = $canonical ?: url()->current(); // Idiomas: la fuente es config/idiomas.php (el registro de la web pública). // `alternativas()` devuelve SOLO las variantes que existen de verdad para // esta página, así que el hreflang es recíproco por construcción y nunca // declara un idioma sin traducción. $alternativas = \App\Support\Idiomas::alternativas(); $ogLocale = \App\Support\Idiomas::og(\App\Support\Idiomas::actual()) ?? 'es_ES'; $altLocales = collect($alternativas) ->except(\App\Support\Idiomas::actual()) ->keys() ->map(fn ($l) => \App\Support\Idiomas::og($l)) ->filter() ->values() ->all(); $twitter = config('seo.twitter'); @endphp