Commit bd61752b authored by Yassine Doghri's avatar Yassine Doghri
Browse files

feat(meta-tags): add activitypub alternate links to podcast, episode, comment and post pages

parent 3ce07e45
Pipeline #1195 passed with stages
in 7 minutes and 27 seconds
......@@ -44,7 +44,12 @@ if (! function_exists('get_podcast_metatags')) {
->og('image:width', (string) config('Images')->podcastCoverSizes['large']['width'])
->og('image:height', (string) config('Images')->podcastCoverSizes['large']['height'])
->og('locale', $podcast->language_code)
->og('site_name', service('settings')->get('App.siteName'));
->og('site_name', service('settings')->get('App.siteName'))
->push('link', [
'rel' => 'alternate',
'type' => 'application/activity+json',
'href' => url_to('podcast-activity', $podcast->handle),
]);
if ($podcast->payment_pointer) {
$metatags->meta('monetization', $podcast->payment_pointer);
......@@ -94,7 +99,12 @@ if (! function_exists('get_episode_metatags')) {
->twitter('audio:artist_name', $episode->podcast->owner_name)
->twitter('player', $episode->getEmbedUrl('light'))
->twitter('player:width', (string) config('Embed')->width)
->twitter('player:height', (string) config('Embed')->height);
->twitter('player:height', (string) config('Embed')->height)
->push('link', [
'rel' => 'alternate',
'type' => 'application/activity+json',
'href' => url_to('episode', $episode->podcast->handle, $episode->slug),
]);
if ($episode->podcast->payment_pointer) {
$metatags->meta('monetization', $episode->podcast->payment_pointer);
......@@ -149,7 +159,12 @@ if (! function_exists('get_post_metatags')) {
->description($post->message)
->image($post->actor->avatar_image_url)
->canonical((string) current_url())
->og('site_name', service('settings')->get('App.siteName'));
->og('site_name', service('settings')->get('App.siteName'))
->push('link', [
'rel' => 'alternate',
'type' => 'application/activity+json',
'href' => url_to('post', $post->actor->username, $post->id),
]);
return $metatags->__toString() . PHP_EOL . $schema->__toString();
}
......@@ -183,7 +198,17 @@ if (! function_exists('get_episode_comment_metatags')) {
->description($episodeComment->message)
->image($episodeComment->actor->avatar_image_url)
->canonical((string) current_url())
->og('site_name', service('settings')->get('App.siteName'));
->og('site_name', service('settings')->get('App.siteName'))
->push('link', [
'rel' => 'alternate',
'type' => 'application/activity+json',
'href' => url_to(
'episode-comment',
$episodeComment->actor->username,
$episodeComment->episode->slug,
$episodeComment->id
),
]);
return $metatags->__toString() . PHP_EOL . $schema->__toString();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment