eleventy-plugin-podcaster 1.2.1 → 1.3.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 +8 -4
- package/package.json +1 -1
package/eleventy.config.js
CHANGED
|
@@ -93,14 +93,18 @@ export default function (eleventyConfig, options = {}) {
|
|
|
93
93
|
})
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
eleventyConfig.addFilter('readableDuration',
|
|
96
|
+
eleventyConfig.addFilter('readableDuration', (seconds, omitLeadingZero) => {
|
|
97
97
|
if (!seconds) return '0:00:00'
|
|
98
|
-
|
|
98
|
+
if (omitLeadingZero && seconds < 3600) {
|
|
99
|
+
return Duration.fromMillis(seconds * 1000).toFormat('mm:ss')
|
|
100
|
+
}
|
|
99
101
|
return Duration.fromMillis(seconds * 1000).toFormat('h:mm:ss')
|
|
100
102
|
})
|
|
101
103
|
|
|
102
|
-
eleventyConfig.addFilter('readableSize', bytes =>
|
|
103
|
-
|
|
104
|
+
eleventyConfig.addFilter('readableSize', (bytes, fixedPrecision) =>
|
|
105
|
+
(fixedPrecision)
|
|
106
|
+
? hr.fromBytes(bytes, { fixedPrecision })
|
|
107
|
+
: hr.fromBytes(bytes)
|
|
104
108
|
)
|
|
105
109
|
|
|
106
110
|
const podcastFeedPath = path.join(import.meta.dirname, './src/podcastFeed.njk')
|