eleventy-plugin-podcaster 1.3.0 → 1.4.0
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/eleventy.config.js
CHANGED
|
@@ -116,6 +116,20 @@ 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.tags?.includes('podcastEpisode')) {
|
|
123
|
+
if (data.episode?.seasonNumber) {
|
|
124
|
+
return `/s${data.episode.seasonNumber}/e${data.episode.episodeNumber}/`
|
|
125
|
+
} else {
|
|
126
|
+
return `/${data.episode.episodeNumber}/`
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
}
|
|
132
|
+
|
|
119
133
|
eleventyConfig.addPlugin(calculateFilenameSizeAndDuration, options)
|
|
120
134
|
eleventyConfig.addPlugin(excerpts, options)
|
|
121
135
|
eleventyConfig.addPlugin(drafts, options)
|
package/package.json
CHANGED
|
@@ -8,7 +8,8 @@ import chalk from 'chalk'
|
|
|
8
8
|
|
|
9
9
|
const convertSecondsToReadableDuration = seconds =>
|
|
10
10
|
Duration.fromMillis(seconds * 1000)
|
|
11
|
-
.
|
|
11
|
+
.shiftTo('days', 'hours', 'minutes', 'seconds')
|
|
12
|
+
.toHuman()
|
|
12
13
|
|
|
13
14
|
export default function (eleventyConfig, options = {}) {
|
|
14
15
|
let firstRun = true
|