Commit 902f959b authored by Yassine Doghri's avatar Yassine Doghri
Browse files

feat: add schema.org json-ld objects to podcasts, episodes, posts and comments pages

- refactor meta-tags by generating them in the controller and injecting them into the views
- use
`melbahja/seo` library to build opengraph and twitter meta-tags + schema.org objects
parent 5c529a83
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -435,6 +435,8 @@ class App extends BaseConfig
     */
    public string $siteName = 'Castopod';

    public string $siteTitleSeparator = ' | ';

    public string $siteDescription = 'Castopod Host is an open-source hosting platform made for podcasters who want engage and interact with their audience.';

    /**

app/Config/Embed.php

0 → 100644
+19 −0
Original line number Diff line number Diff line
<?php

declare(strict_types=1);

namespace Config;

use CodeIgniter\Config\BaseConfig;

class Embed extends BaseConfig
{
    /**
     * --------------------------------------------------------------------------
     * Embeddable player config
     * --------------------------------------------------------------------------
     */
    public int $width = 600;

    public int $height = 144;
}
+2 −2
Original line number Diff line number Diff line
@@ -180,10 +180,10 @@ $routes->group('@(:podcastHandle)', function ($routes): void {
$routes->get('/credits', 'CreditsController', [
    'as' => 'credits',
]);
$routes->get('/map', 'MapMarkerController', [
$routes->get('/map', 'MapController', [
    'as' => 'map',
]);
$routes->get('/episodes-markers', 'MapMarkerController::getEpisodesMarkers', [
$routes->get('/episodes-markers', 'MapController::getEpisodesMarkers', [
    'as' => 'episodes-markers',
]);
$routes->get('/pages/(:slug)', 'PageController/$1', [
+3 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ class ActorController extends FediverseActorController
    /**
     * @var string[]
     */
    protected $helpers = ['auth', 'svg', 'components', 'misc'];
    protected $helpers = ['auth', 'svg', 'components', 'misc', 'seo'];

    public function follow(): string
    {
@@ -34,6 +34,8 @@ class ActorController extends FediverseActorController
        if (! ($cachedView = cache($cacheName))) {
            helper(['form', 'components', 'svg']);
            $data = [
                // @phpstan-ignore-next-line
                'metatags' => get_follow_metatags($this->actor),
                'actor' => $this->actor,
            ];

+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ class BaseController extends Controller
        ResponseInterface $response,
        LoggerInterface $logger
    ): void {
        $this->helpers = array_merge($this->helpers, ['auth', 'svg', 'components', 'misc']);
        $this->helpers = array_merge($this->helpers, ['auth', 'svg', 'components', 'misc', 'seo']);

        // Do Not Edit This Line
        parent::initController($request, $response, $logger);
Loading