|
| 1 | +@php |
| 2 | +use App\Services\FrontendService; |
| 3 | +use Illuminate\Support\Str; |
| 4 | +
|
| 5 | +$appName = FrontendService::getAppName(); |
| 6 | +$appDesc = FrontendService::getAppDescription(); |
| 7 | +
|
| 8 | +$videoTitle = $videoData |
| 9 | + ? ($videoData['caption'] ? Str::limit($videoData['caption'], 26) . " - @" . $videoData['account']['username'] . " | {$appName}" : "@{$videoData['account']['username']} | {$appName}") |
| 10 | + : $appName; |
| 11 | +
|
| 12 | +$videoDesc = $appDesc; |
| 13 | +$videoLikes = data_get($videoData, 'likes', 0); |
| 14 | +$videoComments = data_get($videoData, 'comments', 0); |
| 15 | +$videoUrl = data_get($videoData, 'url', url('/')); |
| 16 | +$videoThumbnail = data_get($videoData, 'media.thumbnail', url('/storage/avatars/default.jpg')); |
| 17 | +$authorName = data_get($videoData, 'account.name', ''); |
| 18 | +$authorUsername = data_get($videoData, 'account.username', ''); |
| 19 | +$authorAvatar = data_get($videoData, 'account.avatar', url('/storage/avatars/default.jpg')); |
| 20 | +
|
| 21 | +if ($videoData) { |
| 22 | + if (!empty($videoData['captionText'])) { |
| 23 | + $videoDesc = $videoData['captionText']; |
| 24 | + } elseif (!empty($videoData['caption'])) { |
| 25 | + $stats = "{$videoLikes} likes · {$videoComments} comments"; |
| 26 | + $videoDesc = "{$videoData['caption']} • {$stats}"; |
| 27 | + } |
| 28 | +} |
| 29 | +@endphp |
| 30 | +<!DOCTYPE html> |
| 31 | +<html> |
| 32 | +<head> |
| 33 | + <meta charset="utf-8"> |
| 34 | + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 35 | + <title>{{ $videoTitle }}</title> |
| 36 | + <link rel="shortcut icon" type="image/png" href="{{ url('/favicon.png') }}"/> |
| 37 | + |
| 38 | + <meta name="description" content="{{ $videoDesc }}"> |
| 39 | + <meta name="author" content="{{ $authorName }} ({{ '@' . $authorUsername }})"> |
| 40 | + |
| 41 | + <meta property="og:title" content="{{ $videoTitle }}" /> |
| 42 | + <meta property="og:description" content="{{ $videoDesc }}" /> |
| 43 | + <meta property="og:type" content="video.other" /> |
| 44 | + <meta property="og:url" content="{{ $videoUrl }}" /> |
| 45 | + <meta property="og:image" content="{{ $videoThumbnail }}" /> |
| 46 | + <meta name="twitter:card" content="summary" /> |
| 47 | + <meta name="twitter:title" content="{{ $videoTitle }}" /> |
| 48 | + <meta name="twitter:description" content="{{ $videoDesc }}" /> |
| 49 | + <meta name="twitter:image" content="{{ $videoThumbnail }}" /> |
| 50 | + <meta property="video:release_date" content="{{ $videoData['created_at'] ?? '' }}" /> |
| 51 | + |
| 52 | + <meta property="article:author" content="{{ url('/@' . $authorUsername) }}" /> |
| 53 | + |
| 54 | + @vite(['resources/js/app.js']) |
| 55 | + {!! FrontendService::getCustomCss() !!} |
| 56 | + |
| 57 | + <script type="text/javascript"> |
| 58 | + window.appConfig = {!! FrontendService::getAppData() !!}; |
| 59 | + window._navi = {!! App\Services\PageService::getActiveSideLinks() !!}; |
| 60 | + {!! FrontendService::getCaptchaData() !!} |
| 61 | + </script> |
| 62 | +</head> |
| 63 | + |
| 64 | +<body class="bg-white dark:bg-slate-950"> |
| 65 | + <main id="app"> |
| 66 | + <router-view></router-view> |
| 67 | + </main> |
| 68 | +</body> |
| 69 | +</html> |
0 commit comments