nerdhaus / eleventy-podcast

A relatively cruft-free podcasting starter kit for Eleventy
MIT License
2 stars 0 forks source link

External audio hosting #6

Open eaton opened 3 years ago

eaton commented 3 years ago

Out of box we're using the vanilla "media library" configuration for NetlifyCMS that stores everything (images, mp3s, etc) in an uploads folder in the git repo itself. It works for the demo site and is probably even fine for some simple podcasts but it'd be great to handle things better for more complex ones.

Issues to consider:

eaton commented 3 years ago

A couple of useful notes on the Filesize/Duration detection: rather than having complex logic in the display templates to convert filenames into remote vs local URLs, we can use calculated computed data in eleventy. For example, the episodes.json currently specifies shared properties that all episodes have; using straight JS in the form of episodes.11ty.js would allow us to transform each post's frontmatter to produce calculated "final" values.

Taking an mp3 filename, then taking global settings about file storage into account to generate a final URL, would be easy with this mechanism. Calculated frontmatter values can also make use of async functions — making remote requests to get filesize/filemeta, etc.