I’m running the latest Ghost with Casper, and I want to post podcasts. As of now, there’s no good way to do that, and due to lack of podcasters using Ghost, I don’t expect this to become core functionality. Here’s what I’m trying to accomplish:
When a post contains an .mp3 url, it will become a podcast
Some code will be injected right above this URL and will display an HTML5-compatible player (say, wavesurfer.js)
URL itself will be updated to a proper link: “Download Episode #xxx”
A proper enclosure tag will be created and injected into the post as invisible code (?)
This enclosure will be available for this particular post in RSS for further syndication
This updated post will be saved back into the database
I’m not really sure about the best way to approach this. I’ve been able to make points 1 through 3 work with content helper, so whenever there’s an mp3 url in the post, it becomes a media player with the download link below.
How do I add an enclosure to the post so it appears in the RSS? And what’s the proper way to take this whole post object afterwards and post it back to the database as an update (I’m using MySQL at the time)?
Any suggestions and pointers are very welcome, as documentation is limited and not always clear about accomplishing this kind of thing. Thank you!
What you would like to do requires working on the core.
I don’t know if that might be an alternative option for you, but you could achieve some of the above mentioned points easily by using the dynamic routing feature. This will also give you the option to create your own RSS feed:
When a post contains an .mp3 url, it will become a podcast
Manually tag it with podcast
Some code will be injected right above this URL and will display an HTML5-compatible player (say, wavesurfer.js)
URL itself will be updated to a proper link: “Download Episode #xxx”
Custom template that uses some js for podcast posts
A proper enclosure tag will be created and injected into the post as invisible code (?)
This enclosure will be available for this particular post in RSS for further syndication
This updated post will be saved back into the database
I don’t think this will be necessary. You’ll define your very own routes and create an RSS template only for podcast posts, which are separate from the normal posts.