Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External audio hosting #6

Open
3 tasks
eaton opened this issue Nov 23, 2020 · 1 comment
Open
3 tasks

External audio hosting #6

eaton opened this issue Nov 23, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@eaton
Copy link
Member

eaton commented Nov 23, 2020

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:

  • NetlifyCMS integration — add a media provider or just turn off library management and let them enter the mp3 filepath as a string?
  • Filesize/Duration detection — we're using an eleventy plugin that checks local files, moving to external hosting would require fancier treatment or manual entry of size/duration in the episode frontmatter. We have properties for that but it feels like better handling would be nice.
  • URL Generation — it'd be nice if the remote/local question was abstracted away by the time "what's the URL for this podcast episode" is asked at the template level. Maybe a helper filter or shortcode that wraps all of the if/then checking.
@eaton eaton added the enhancement New feature or request label Nov 23, 2020
@eaton
Copy link
Member Author

eaton commented Dec 2, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant