diff --git a/docs/docs/templates.md b/docs/docs/templates.md index cba4fdd..359de53 100644 --- a/docs/docs/templates.md +++ b/docs/docs/templates.md @@ -29,3 +29,4 @@ This template will be used to create the note text. You can use the following sy - `{{date}}`: The publish date of the podcast episode. - You can use `{{date:format}}` to specify a custom [Moment.js](https://momentjs.com) format. E.g. `{{date:YYYY-MM-DD}}`. - `{{artwork}}`: The URL of the podcast artwork. If no artwork is found, an empty string will be used. +- `{{stream}}`: The URL of the podcast audio file for the episode. diff --git a/src/TemplateEngine.ts b/src/TemplateEngine.ts index 078f61d..fff3636 100644 --- a/src/TemplateEngine.ts +++ b/src/TemplateEngine.ts @@ -100,7 +100,7 @@ export function NoteTemplateEngine(template: string, episode: Episode) { return htmlToMarkdown(episode.content); }); addTag("safetitle", replaceIllegalFileNameCharactersInString(episode.title)); - addTag("stream", episode.streamUrl); + addTag("stream", episode.streamUrl ?? ""); addTag("url", episode.url); addTag("date", (format?: string) => episode.episodeDate diff --git a/src/ui/settings/PodNotesSettingsTab.ts b/src/ui/settings/PodNotesSettingsTab.ts index 465d83a..5fe0af4 100644 --- a/src/ui/settings/PodNotesSettingsTab.ts +++ b/src/ui/settings/PodNotesSettingsTab.ts @@ -215,6 +215,8 @@ export class PodNotesSettingsTab extends PluginSettingTab { "\nPublishDate:: {{date:YYYY-MM-DD}}" + "\n### Description" + "\n> {{description}}", + "\n### Audio File URL" + + "\n> {{stream}}", ); });