@extends('layouts.app', [ 'title' => $desc ?? "{$user->username} shared a post", 'ogTitle' => $ogTitle ]) @php $s = \App\Services\StatusService::get($status->id, false); $displayName = $s && $s['account'] ? $s['account']['display_name'] : false; $captionPreview = false; $domain = $displayName ? '@' . parse_url($s['account']['url'], PHP_URL_HOST) : ''; $wf = $displayName ? $s['account']['username'] . $domain : ''; $ogTitle = $displayName ? $displayName . ' (@' . $s['account']['username'] . $domain . ')' : ''; $mediaCount = $s['media_attachments'] && count($s['media_attachments']) ? count($s['media_attachments']) : 0; $mediaSuffix = $mediaCount < 2 ? '' : 's'; $ogDescription = $s['content_text'] ? $s['content_text'] : 'Attached: ' . $mediaCount . ' ' . $s['media_attachments'][0]['type'] . $mediaSuffix; if($s['content_text']) { $captionLen = strlen($s['content_text']); $captionPreview = $captionLen > 40 ? substr($s['content_text'], 0, 40) . '…' : $s['content_text']; } $desc = false; if($displayName && $captionPreview) { $desc = $displayName . ': "' . $captionPreview . '" - Pixelfed'; } else if($displayName) { $desc = $displayName . ': Shared a new post - Pixelfed'; } @endphp @section('content')