From 32e8c7c16a61ffe08e2f3bfbdeda556811a0358c Mon Sep 17 00:00:00 2001 From: Yassine Doghri Date: Sat, 24 Jul 2021 08:49:16 +0000 Subject: [PATCH] feat(rss): add podcast:comments tag to link to episode comments --- .devcontainer/devcontainer.json | 2 +- app/Helpers/rss_helper.php | 5 +++++ docs/setup-development.md | 18 +++++++++++------- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1d842ae0..71a8104d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,7 @@ "service": "app", "workspaceFolder": "/castopod-host", "postCreateCommand": "composer install && npm install && npm run build:static", - "postStartCommand": "crontab ./crontab && cron && php spark serve --host 0.0.0.0 & npm run dev", + "postStartCommand": "crontab ./crontab && cron && php spark serve --host 0.0.0.0", "postAttachCommand": "crontab ./crontab && service cron reload", "shutdownAction": "stopCompose", "settings": { diff --git a/app/Helpers/rss_helper.php b/app/Helpers/rss_helper.php index 10079326..502b2f7b 100644 --- a/app/Helpers/rss_helper.php +++ b/app/Helpers/rss_helper.php @@ -249,6 +249,11 @@ if (! function_exists('get_rss_feed')) { $item->addChild('season', $episode->season_number, $itunesNamespace); $item->addChild('episodeType', $episode->type, $itunesNamespace); + // add link to episode comments as podcast-activity format + $comments = $item->addChild('comments', null, $podcastNamespace); + $comments->addAttribute('uri', url_to('episode-comments', $podcast->name, $episode->slug)); + $comments->addAttribute('contentType', 'application/podcast-activity+json'); + if ($episode->transcript_file_url) { $transcriptElement = $item->addChild('transcript', null, $podcastNamespace); $transcriptElement->addAttribute('url', $episode->transcript_file_url); diff --git a/docs/setup-development.md b/docs/setup-development.md index cb21900c..23721a24 100644 --- a/docs/setup-development.md +++ b/docs/setup-development.md @@ -90,17 +90,21 @@ required services will be loaded automagically! > The VSCode window will reload inside the dev container. Expect several > minutes during first load as it is building all necessary services. - **Note**: The dev container will start by running both the Castopod Host - server and [Vite](https://vitejs.dev)'s dev server (for compiling the - typescript code and styles). If there is any issue with the servers not - running, you can restart them using the following commands: + **Note**: The dev container will start by running Castopod Host's php server. + During development, you will have to start [Vite](https://vitejs.dev)'s dev + server for compiling the typescript code and styles: + + ```bash + # run Vite dev server + npm run dev + ``` + + If there is any issue with the php server not running, you can restart them + using the following commands: ```bash # run Castopod host server php spark serve --host 0.0.0.0 - - # run Vite dev server - npm run dev ``` 3. You're all set! 🎉