eleventy-plugin-podcaster 1.2.0 → 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/README.md CHANGED
@@ -10,7 +10,7 @@ Plenty of services exist that will host your podcast online — [Spotify][], [Ac
10
10
  [Buzzsprout]: https://www.buzzsprout.com
11
11
  [Blubrry]: https://blubrry.com
12
12
 
13
- But **Podcaster** will.
13
+ But Eleventy and **Podcaster** will.
14
14
 
15
15
  ## Installation
16
16
 
@@ -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.0",
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": {
@@ -55,9 +55,9 @@ eleventyAllowMissingExtension: true
55
55
  {%- endif %}
56
56
  <link>{{ post.url | htmlBaseUrl(siteUrl) }}</link>
57
57
  {%- if post.data.guid != undefined %}
58
- <guid isPermalink="false">{{ post.data.guid }}</guid>
58
+ <guid isPermaLink="false">{{ post.data.guid }}</guid>
59
59
  {% else %}
60
- <guid isPermalink="true">{{ post.url | htmlBaseUrl(siteUrl) }}</guid>
60
+ <guid isPermaLink="true">{{ post.url | htmlBaseUrl(siteUrl) }}</guid>
61
61
  {% endif -%}
62
62
  <pubDate>{{ post.date | dateToRfc3339 }}</pubDate>
63
63
  {% if podcast.episodeDescriptionTemplate %}