@php use Illuminate\Support\Facades\File; use App\Support\Tenant\StoragePaths; $tenantId = $tenantId ?? (tenant() ? tenant('id') : null); $scope = $scope ?? ($tenantId ? 'tenant' : 'platform'); $settings = $tenantSiteSettings ?? null; $siteName = $siteName ?? ($settings?->site_name ?? 'qpost'); $siteDescription = $siteDescription ?? ($settings?->site_description ?? 'qpost'); $tenantBaseUrl = tenant_base_url(); $basePath = $basePath ?? $tenantBaseUrl; $faviconUrl = $faviconUrl ?? ($tenantId ? tenant_file_url($settings?->favicon_path) : null); $ogImageUrl = $ogImageUrl ?? ($tenantId ? tenant_file_url($settings?->og_image_path) : null); $metaVerifications = $settings?->effectiveMetaVerifications() ?? []; $adsenseClientId = $settings?->effectiveAdsenseClientId(); $bodyClass = $bodyClass ?? 'min-h-screen bg-base c-main scope-tenant theme-default'; $tenantStylePath = $tenantId ? StoragePaths::styleAbsolutePath($tenantId) : null; $tenantStyleVersion = $tenantStylePath && File::exists($tenantStylePath) ? filemtime($tenantStylePath) : null; $tenantStyleUrl = $tenantStyleVersion ? tenant_url(null, 'style.css') . '?v=' . $tenantStyleVersion : null; @endphp @php $defaultSeoTitle = $settings?->effectiveSeoTitle() ?: $siteName; $defaultSeoDescription = $settings?->effectiveSeoDescription() ?: $siteDescription; $defaultSeoKeywords = $settings?->effectiveSeoKeywords() ?: ''; $defaultSeoCanonicalUrl = rtrim(tenant_canonical_url(), '/') . '/'; $defaultSeoOgTitle = $settings?->effectiveSeoOgTitle() ?: $defaultSeoTitle; $defaultSeoOgDescription = $settings?->effectiveSeoOgDescription() ?: $defaultSeoDescription; $defaultSeoOgImage = $settings?->effectiveSeoOgImageUrl() ?: ($ogImageUrl ?? ''); $pageTitle = trim((string) $__env->yieldContent('title', $defaultSeoTitle)); $pageDescription = trim((string) $__env->yieldContent('meta-description', $defaultSeoDescription)); $pageKeywords = trim((string) $__env->yieldContent('meta-keywords', '')); $pageCanonicalUrl = trim((string) $__env->yieldContent('canonical-url', $defaultSeoCanonicalUrl)); $pageOgTitle = trim((string) $__env->yieldContent('og-title', $defaultSeoOgTitle)); $pageOgDescription = trim((string) $__env->yieldContent('og-description', $defaultSeoOgDescription)); $pageOgType = trim((string) $__env->yieldContent('og-type', 'website')); $pageOgImage = trim((string) $__env->yieldContent('og-image', $defaultSeoOgImage)); $pageRobots = trim((string) $__env->yieldContent('meta-robots', $settings?->indexable ? 'index,follow' : 'noindex,follow')); $decodeMetaText = static function (string $value): string { $value = html_entity_decode($value, ENT_QUOTES | ENT_HTML5, 'UTF-8'); $value = html_entity_decode($value, ENT_QUOTES | ENT_HTML5, 'UTF-8'); return trim($value); }; $pageTitle = $decodeMetaText($pageTitle); $pageDescription = $decodeMetaText($pageDescription); $pageKeywords = $decodeMetaText($pageKeywords ?: $defaultSeoKeywords); $pageOgTitle = $decodeMetaText($pageOgTitle); $pageOgDescription = $decodeMetaText($pageOgDescription); $pageOgImage = $decodeMetaText($pageOgImage); @endphp {{ $pageTitle }} @if ($pageKeywords !== '') @endif @if ($faviconUrl) @endif @if ($pageOgImage !== '') @endif @foreach ($metaVerifications as $verification) @endforeach @if ($adsenseClientId) @endif @vite(['resources/css/app.css', 'resources/css/themes/default.css', 'resources/js/app.js', 'resources/js/tenant.js']) @if ($tenantStyleUrl) @endif @stack('head') @stack('styles') @yield('body-top') @yield('body') @stack('scripts')