eleventy-plugin-podcaster 1.3.0 → 1.4.1

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.
@@ -116,6 +116,22 @@ export default function (eleventyConfig, options = {}) {
116
116
  }
117
117
  })
118
118
 
119
+ if (options.handleEpisodePermalinks) {
120
+ eleventyConfig.addGlobalData('eleventyComputed.permalink', () => {
121
+ return data => {
122
+ if (data.permalink) return data.permalink
123
+
124
+ if (data.tags?.includes('podcastEpisode')) {
125
+ if (data.episode?.seasonNumber) {
126
+ return `/s${data.episode.seasonNumber}/e${data.episode.episodeNumber}/`
127
+ } else {
128
+ return `/${data.episode.episodeNumber}/`
129
+ }
130
+ }
131
+ }
132
+ })
133
+ }
134
+
119
135
  eleventyConfig.addPlugin(calculateFilenameSizeAndDuration, options)
120
136
  eleventyConfig.addPlugin(excerpts, options)
121
137
  eleventyConfig.addPlugin(drafts, options)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleventy-plugin-podcaster",
3
- "version": "1.3.0",
3
+ "version": "1.4.1",
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": {
@@ -8,7 +8,8 @@ import chalk from 'chalk'
8
8
 
9
9
  const convertSecondsToReadableDuration = seconds =>
10
10
  Duration.fromMillis(seconds * 1000)
11
- .toFormat("d 'd' h 'h' m 'm' s.SSS 's'")
11
+ .shiftTo('days', 'hours', 'minutes', 'seconds')
12
+ .toHuman()
12
13
 
13
14
  export default function (eleventyConfig, options = {}) {
14
15
  let firstRun = true