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.
@@ -93,14 +93,18 @@ export default function (eleventyConfig, options = {}) {
93
93
  })
94
94
  }
95
95
 
96
- eleventyConfig.addFilter('readableDuration', function (seconds) {
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
- hr.fromBytes(bytes)
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')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleventy-plugin-podcaster",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
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": {