···
use React\Promise\Promise;
use Tracy\OutputDebugger;
$bskyToucher = new BskyToucher();
$favoriteFeeds = array_map(function ($feed) use ($bskyToucher) {
return $bskyToucher->getFeedInfo($feed);
24
+
function getPostOgImage(object $post): ?string {
25
+
if ($post->embedType === 'app.bsky.embed.images') {
26
+
return $post->embeds[0]->imgUrl;
27
+
} else if ($post->embedType === 'app.bsky.embed.external' || $post->embedType === 'app.bsky.embed.video') {
28
+
return $post->embeds[0]->thumb;
29
+
} else if ($post->embedtype === 'app.bsky.embed.record') {
30
+
return getPostOgImage($post->embeds[0]->post);
// This where errors and exceptions will be logged. Make sure this directory exists and is writable.
···
'cursor' => $posts->cursor,
69
-
'feedAtUri' => FRONTPAGE_FEED
81
+
'feedAtUri' => FRONTPAGE_FEED,
82
+
'ogtitle' => SITE_TITLE,
83
+
'ogdesc' => SITE_DESC,
85
+
'ogurl' => SITE_DOMAIN.'/'
···
88
-
'replies' => $replies
104
+
'replies' => $replies,
105
+
'ogtitle' => SITE_TITLE." | ".$post->author->displayName." (@".$post->author->handle.")",
106
+
'ogdesc' => $post->content,
107
+
'ogimage' => getPostOgImage($post),
108
+
'ogurl' => SITE_DOMAIN.'/u/'.$handle.'/'.$rkey
···
'mainClass' => 'profile',
122
+
'ogtitle' => SITE_TITLE." | ".$user->displayName." (@".$user->handle.")",
123
+
'ogdesc' => $user->description,
124
+
'ogimage' => $user->avatar,
125
+
'ogurl' => SITE_DOMAIN.'/u/'.$user->handle.'/'
···
'feedAuthorName' => $creatorInfo->displayName,
'feedAuthorHandle' => $creatorInfo->handle,
'feedAuthorDid' => $creatorInfo->did,
123
-
'feedAuthorPds' => $creatorInfo->pds
147
+
'feedAuthorPds' => $creatorInfo->pds,
148
+
'ogtitle' => SITE_TITLE." | ".$feedInfo->title,
149
+
'ogdesc' => $feedInfo->description,
150
+
'ogimage' => $feedInfo->avatar,
151
+
'ogurl' => SITE_DOMAIN.'/f/'.$did.'/'.$name
···
$latte = new Latte\Engine;
$latte->render('./templates/search.latte', array_merge(Flight::get('standardParams'), [
160
+
'ogtitle' => SITE_TITLE." | search".(array_key_exists('s', $_GET) ? ': '.$_GET['s'] : ''),
161
+
'ogdesc' => SITE_DESC,
163
+
'ogurl' => SITE_DOMAIN.'/u/'.$handle.'/'.$rkey
Flight::route('GET /login', function(): void {
$latte = new Latte\Engine;
$latte->render('./templates/login.latte', array_merge(Flight::get('standardParams'), [
138
-
'mainClass' => 'form'
170
+
'mainClass' => 'form',
171
+
'ogtitle' => SITE_TITLE." | login",
172
+
'ogdesc' => SITE_DESC,
174
+
'ogurl' => SITE_DOMAIN.'/login'
···
Flight::route('/createaccount', function(): void {
$latte = new Latte\Engine;
$latte->render('./templates/create.latte', array_merge(Flight::get('standardParams'), [
149
-
'mainClass' => 'form'
185
+
'mainClass' => 'form',
186
+
'ogtitle' => SITE_TITLE." | create account",
187
+
'ogdesc' => SITE_DESC,
189
+
'ogurl' => SITE_DOMAIN.'/createaccount'
···
$md = $converter->convert(file_get_contents('./pages/'.$page.'.md'));
$latte->render('./templates/page.latte', array_merge(Flight::get('standardParams'), [
231
+
'ogtitle' => SITE_TITLE." | ".$page,
232
+
'ogdesc' => SITE_DESC,
234
+
'ogurl' => SITE_DOMAIN.'/'.$page