eleventy-plugin-podcaster 0.9.3 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,6 +36,7 @@ Here's a detailed description of the data you need to provide here.
36
36
  | `title` | The title of the episode; this will also be the title of the post on the website. | yes |
37
37
  | `date` | The release date of the episode; this will also be the date of the post on the website | yes |
38
38
  | `tags` | Every episode post must have the tag `podcastEpisode` included in the `tags` array. Other tags are also permitted. | yes |
39
+ | `guid` | A unique ID for the post. Normally this will be the post's URL, in which case there is no need to provide it here. It's should really only be necessary to provide it if you're importing the podcast from some other system that has assigned a guid to each post. | no |
39
40
  | `episode.filename` | The filename of the episode's audio file. | yes |
40
41
  | `episode.seasonNumber` | The season number. (Most podcasts don't group their episodes into seasons.) | no |
41
42
  | `episode.episodeNumber` | The episode number. Needn't be unique, but the combination of `seasonNumber` and `episodeNumber` must be unique. | yes |
@@ -42,6 +42,7 @@ However, `eleventy-plugin-podcast` is quite customisable. He's another `podcast.
42
42
  "episodeUrlBase": "https://example.fte-cdn.com/",
43
43
  "feedEpisodeContentTemplate": "feed-episode-content.njk",
44
44
  "feedEpisodeDescriptionTemplate": "feed-episode-description.njk"
45
+ "feedEpisodeSummaryTemplate": "feed-episode-summary.njk"
45
46
  }
46
47
  ```
47
48
 
@@ -67,8 +68,28 @@ And here's a detailed description of all of this information.
67
68
  | `copyright` | The copyright owner of the podcast. If omitted, the value supplied for `author` is used instead. | no |
68
69
  | `startingYear` | The year your podcast started. Used to express the copyright date as a range (_"© 2014–2024 Flight Through Entirety"_). If this is omitted, the copyright date will just be the current year. | no |
69
70
  | `episodeUrlBase` | If you store your podcast episodes on a CDN, or if you use a podcast analytics service, this is where you specify the base URL for them. If you don't specify this, it defaults to `https://{{ podcast.siteUrl }}/episodes/` | no |
70
- | `feedEpisodeContentTemplate` | The name of an include template that will be used to create the show notes of each episode, as displayed in your listeners' podcast players. The content of this template should be HTML. You only need to include this if you want the show notes in podcast players to be different from the show notes on the website. | no |
71
- | `feedEpisodeDescriptionTemplate` | The name of an include template that will be used to create the description of each episode. The content of this template should be plain text. If it's omitted, the description will just be an abbreviated text version of the `content` of the episode's post. | no |
72
71
 
73
72
  [categories]: https://podcasters.apple.com/support/1691-apple-podcasts-categories
74
73
  [lang]: https://www.rssboard.org/rss-language-codes
74
+
75
+ ## Feed episode templates
76
+
77
+ For each episode of the podcast, the feed can contain three textual descriptions — `content`, `description` and `summary`. `content` is HTML and will contain the show notes of an episode. `description` and `summary` are short plain text descriptions of the episode.
78
+
79
+ By default, **Podcaster** will set the `content` of the feed to the `content` of an episode's post, and will set `summary` and `description` to an abbreviated version of the content (roughly the first 500 characters of the `content`). And this will be perfectly fine for most podcast feeds.
80
+
81
+ However, if you want to, you can override any or all of these three textual descriptions by providing special templates in the includes directory and adding their names to the `podcast` object.
82
+
83
+ | field | value | required? |
84
+ | ----- | ----- | --------- |
85
+ | `feedEpisodeContentTemplate` | The name of an include template that will be used to create the show notes of each episode, as displayed in your listeners' podcast players. The content of this template should be HTML. You only need to include this if you want the show notes in podcast players to be different from the show notes on the website. | no |
86
+ | `feedEpisodeDescriptionTemplate` | The name of an include template that will be used to create the description of each episode. The content of this template should be plain text. If it's omitted, the description will just be an abbreviated text version of the `content` of the episode's post. | no |
87
+ | `feedEpisodeSummaryTemplate` | The name of an include template that will be used to create the summary of each episode. The content of this template should be plain text. If it's omitted, the description will just be an abbreviated text version of the `content` of the episode's post. | no |
88
+
89
+ These templates must be Nunjucks templates, and the post for the episode must be referred to by the variable `post`. Here's a sample content template from one of my podcast websites.
90
+
91
+ ```njk
92
+ <p class="diary-date">{{ post.data.diaryDate | readableDate }}</p>
93
+ <p class="topic">{{ post.data.topic }}</p>
94
+ {{ post.content | safe }}
95
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleventy-plugin-podcaster",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "An Eleventy plugin that allows you to create a podcast and its accompanying website",
5
5
  "main": "eleventy.config.js",
6
6
  "exports": {
@@ -52,6 +52,14 @@ eleventyAllowMissingExtension: true
52
52
  <itunes:season>{{ post.data.episode.seasonNumber }}</itunes:season>
53
53
  {%- endif %}
54
54
  <itunes:episode>{{ post.data.episode.episodeNumber }}</itunes:episode>
55
+ {% if podcast.feedEpisodeSummaryTemplate %}
56
+ {%- set episodeSummary -%}
57
+ {% include podcast.feedEpisodeSummaryTemplate %}
58
+ {%- endset -%}
59
+ {% else %}
60
+ {%- set episodeSummary = post.content | striptags(true) | truncate(500) -%}
61
+ {%- endif %}
62
+ <itunes:summary>{{ episodeSummary }}</itunes:summary>
55
63
  {% if podcast.feedEpisodeDescriptionTemplate %}
56
64
  {%- set episodeDescription -%}
57
65
  {% include podcast.feedEpisodeDescriptionTemplate %}
@@ -59,7 +67,6 @@ eleventyAllowMissingExtension: true
59
67
  {% else %}
60
68
  {%- set episodeDescription = post.content | striptags(true) | truncate(800) -%}
61
69
  {%- endif %}
62
- <itunes:summary>{{ episodeDescription }}</itunes:summary>
63
70
  <description>{{ episodeDescription }}</description>
64
71
  {% if podcast.feedEpisodeContentTemplate %}
65
72
  {%- set episodeContent -%}
@@ -68,19 +75,13 @@ eleventyAllowMissingExtension: true
68
75
  {% else %}
69
76
  {%- set episodeContent = post.content -%}
70
77
  {% endif %}
71
- {%- if post.data.page -%}
72
78
  <content:encoded>
73
79
  <![CDATA[{{ episodeContent | renderTransforms(post.data.page, siteUrl) | safe | trim }}]]>
74
80
  </content:encoded>
75
- {%- else -%}
76
- <content:encoded>
77
- <![CDATA[{{ post.content | renderTransforms(post.data.page, siteUrl) | safe | trim }}]]>
78
- </content:encoded>
79
- {% endif %}
80
81
  <enclosure url="{{ post.data.episode.url }}" length="{{ post.data.episode.size }}" type="audio/mp3"></enclosure>
81
82
  <itunes:duration>{{ post.data.episode.duration | readableDuration }}</itunes:duration>
82
83
  {%- if post.data.guid != undefined %}
83
- <guid isPermalink="false">{{ post.data.episode.guid }}</guid>
84
+ <guid isPermalink="false">{{ post.data.guid }}</guid>
84
85
  {% else %}
85
86
  <guid isPermalink="true">{{ post.url | htmlBaseUrl(siteUrl) }}</guid>
86
87
  {% endif -%}