@php
$pageTitle = $post->title;
$pageDescription = $post->meta_description ?: Str::limit(trim(strip_tags($post->content)), 160, '');
$pageKeywords = $post->meta_keywords ?: $post->tags->pluck('name')->implode(', ');
$authorName = $post->user?->name ?? ($post->guest_name ?? '익명');
$pageCanonicalUrl = route('platform.posts.show', ['board' => $board, 'post' => $post]);
$pagePublishedAt = ($post->published_at ?? $post->created_at)?->toAtomString();
$pageModifiedAt = ($post->updated_at ?? $post->published_at ?? $post->created_at)?->toAtomString();
$pageArticleTags = $post->tags->pluck('name')->filter()->values();
$platformPublisherName = $platformSiteSettings?->site_name ?? \App\Models\Platform\SiteSetting::defaultSiteName();
$platformPublisherLogo = $platformSiteSettings?->logo_path ? url('platform/files/' . ltrim($platformSiteSettings->logo_path, '/')) : null;
$pageOgImage = method_exists($post, 'thumbnailUrl') ? ($post->thumbnailUrl() ?: '') : '';
@endphp
@extends('components.layouts.platform-app')
@section('title', $post->title)
@section('meta-description', $pageDescription)
@section('meta-keywords', $pageKeywords)
@section('og-title', $post->title)
@section('og-description', $pageDescription)
@section('canonical-url', $pageCanonicalUrl)
@if ($pageOgImage !== '')
@section('og-image', $pageOgImage)
@endif
@if (! ($isPageSkin ?? false))
@section('og-type', 'article')
@endif
@if (! ($isPageSkin ?? false))
@push('head')
@foreach ($pageArticleTags as $pageArticleTag)
@endforeach
@php
$platformArticleSchema = [
'@context' => 'https://schema.org',
'@type' => 'Article',
'headline' => $post->title,
'description' => $pageDescription,
'datePublished' => $pagePublishedAt,
'dateModified' => $pageModifiedAt,
'mainEntityOfPage' => $pageCanonicalUrl,
'articleSection' => $board->title,
'keywords' => $pageArticleTags->implode(', '),
'author' => [
'@type' => 'Person',
'name' => $authorName,
],
'publisher' => [
'@type' => 'Organization',
'name' => $platformPublisherName,
],
];
if ($platformPublisherLogo) {
$platformArticleSchema['publisher']['logo'] = [
'@type' => 'ImageObject',
'url' => $platformPublisherLogo,
];
}
if ($pageOgImage !== '') {
$platformArticleSchema['image'] = [$pageOgImage];
}
@endphp
@endpush
@endif
@if ($isPageSkin ?? false)
@php
$currentUser = auth('web')->user();
$showPagesToolbar = $currentUser?->isManager() ?? false;
@endphp
@if ($showPagesToolbar)
@section('body-top')