eleventy-plugin-podcaster 2.0.0-alpha.6 → 2.0.0-alpha.8

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleventy-plugin-podcaster",
3
- "version": "2.0.0-alpha.6",
3
+ "version": "2.0.0-alpha.8",
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": {
package/src/chapters.js CHANGED
@@ -8,6 +8,9 @@ export default (eleventyConfig, options = {}) => {
8
8
  }
9
9
  return x
10
10
  })
11
- return JSON.stringify(result, null, 2)
11
+ return JSON.stringify({
12
+ version: '1.2.0',
13
+ chapters: result
14
+ }, null, 2)
12
15
  })
13
16
  }
@@ -47,6 +47,8 @@ export default function (eleventyConfig, options = {}) {
47
47
  })
48
48
 
49
49
  eleventyConfig.addCollection('episodePostWithChapters', (collectionApi) => {
50
- return collectionApi.getAll().filter(item => isEpisodePost(item.data, options) && item.data.episode?.chapters)
50
+ return collectionApi.getAll().filter(item => isEpisodePost(item.data, options) &&
51
+ item.data.episode?.chapters &&
52
+ typeof item.data.episode.chapters !== 'string')
51
53
  })
52
54
  }
@@ -60,7 +60,10 @@ eleventyAllowMissingExtension: true
60
60
  <guid isPermaLink="true">{{ post.url | htmlBaseUrl(siteUrl) }}</guid>
61
61
  {% endif -%}
62
62
  <pubDate>{{ post.date | dateToRfc3339 }}</pubDate>
63
- {%- if post.data.episode.chapters %}
63
+ {%- if post.data.episode.chapters is string %}
64
+ <podcast:chapters url="{{ post.data.episode.chapters | htmlBaseUrl(siteUrl) }}"
65
+ type="application/json+chapters" />
66
+ {% elseif post.data.episode.chapters %}
64
67
  <podcast:chapters url="{{ [post.url, 'chapters.json'] | join('/') | htmlBaseUrl(siteUrl) }}"
65
68
  type="application/json+chapters" />
66
69
  {% endif -%}