Commit 8ae29293 authored by Yassine Doghri's avatar Yassine Doghri
Browse files

feat: add podcast links page including social, podcasting and funding links

parent 63c20da5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -14,6 +14,12 @@
        ]
      }
    ],
    "function-no-unknown": [
      true,
      {
        "ignoreFunctions": ["theme"]
      }
    ],
    "no-descending-specificity": null,
    "selector-class-pattern": null
  }
+3 −0
Original line number Diff line number Diff line
@@ -81,6 +81,9 @@ $routes->group('@(:podcastHandle)', static function ($routes): void {
    $routes->get('manifest.webmanifest', 'WebmanifestController::podcastManifest/$1', [
        'as' => 'podcast-webmanifest',
    ]);
    $routes->get('links', 'PodcastController::links/$1', [
        'as' => 'podcast-links',
    ]);
    // override default Fediverse Library's actor route
    $routes->options('/', 'ActivityPubController::preflight');
    $routes->get('/', 'PodcastController::activity/$1', [
+8 −0
Original line number Diff line number Diff line
@@ -318,4 +318,12 @@ class PodcastController extends BaseController
            ->setContentType('application/activity+json')
            ->setBody($collection->toJSON());
    }

    public function links(): string
    {
        return view('podcast/links', [
            'metatags' => get_podcast_metatags($this->podcast, 'links'),
            'podcast'  => $this->podcast,
        ]);
    }
}
+7 −1
Original line number Diff line number Diff line
@@ -16,12 +16,18 @@ if (! function_exists('render_page_links')) {
     *
     * @return string html pages navigation
     */
    function render_page_links(string $class = null): string
    function render_page_links(string $class = null, string $podcastHandle = null): string
    {
        $pages = (new PageModel())->findAll();
        $links = anchor(route_to('home'), lang('Common.home'), [
            'class' => 'px-2 py-1 underline hover:no-underline focus:ring-accent',
        ]);
        if ($podcastHandle !== null) {
            $links .= anchor(route_to('podcast-links', $podcastHandle), lang('Podcast.links'), [
                'class' => 'px-2 py-1 underline hover:no-underline focus:ring-accent',
            ]);
        }

        $links .= anchor(route_to('credits'), lang('Person.credits'), [
            'class' => 'px-2 py-1 underline hover:no-underline focus:ring-accent',
        ]);
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ return [
        one {# post}
        other {# posts}
    }',
    'links' => 'Links',
    'activity' => 'Activity',
    'episodes' => 'Episodes',
    'episodes_title' => 'Episodes of {podcastTitle}',
Loading