Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brob/eleventy-plugin-podcast-tools
https://github.com/brob/eleventy-plugin-podcast-tools
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/brob/eleventy-plugin-podcast-tools
- Owner: brob
- License: mit
- Created: 2019-12-20T03:09:47.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T17:56:49.000Z (about 1 year ago)
- Last Synced: 2024-04-11T15:46:36.820Z (9 months ago)
- Language: JavaScript
- Size: 47.7 MB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 11ty Plugin Podcast Tools
This is a (potentially) quick and dirty plugin that will give you filters for using 11ty to host your podcast.
## Installation
`npm install eleventy-plugin-podcast-tools`
Add the plugin to your 11ty configuration file (probably `.eleventy.js`).
```js
const podcastTools = require('eleventy-plugin-podcast-tools');module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(podcastTools);...
}
```Use the filters below to get the information you need from your files.
## Filter: Duration
The Duration filter currently only works in Nunjucks (it's a Nunjucks async filter).
### Syntax
In a Nunjucks template, you can use the following filter on a variable or expression that contains a path to an audio file in your project.
```html
{{ path_to_file | duration }}
```This will return the duration of your audio file in the following (iTunes approved?) syntax: `HH:MM:SS` i.e. `01:05:22`
## Filter: File Size
This filter (universal) will return the file size of your audio file in (iTunes approved?) bytes.
```html
{{ path_to_file | filesize }}
```## Feedback
This was quick and dirty based on this twitter thread. If you have feedback, requests, etc. I'm all ears. If you have ideas for improving, I'll 100% accept pull requests of help.