gfscott / eleventy-plugin-embed-everything

An Eleventy plugin to easily embed common media formats in posts, using only their URLs
https://gfscott.com/embed-everything/
MIT License
99 stars 6 forks source link

Feature request: SlideShare support #225

Open RReverser opened 8 months ago

RReverser commented 8 months ago

All my talks historically live on SlideShare and I tend to embed them on my blog for reference.

As I'm moving to 11ty, I'd love to have slide links automatically converted to embeds instead of having to do this manually via iframes.

gfscott commented 8 months ago

[Mostly just making some notes to self:]

Yep, that should be doable, it would need to work similarly to the Soundcloud plugin, which has to make a request via oEmbed to get the embed URL.

The public URL doesn't have a direct relationship to the embed src URL:

Because Slideshare requires making an API call, this plugin would be off by default in the Embed Everything plugin.

RReverser commented 8 months ago

Yep, that should be doable, it would need to work similarly to the Soundcloud plugin, which has to make a request via oEmbed to get the embed URL.

I wonder if it would be "easier" (well, maybe not easier, but at least more universal) to transform current Soundcloud plugin into a generic eleventy-plugin-oembed that would cover any services supporting such API? It's been years since I played with oEmbed, but I remember it being supported by a lot of services.

RReverser commented 8 months ago

Because Slideshare requires making an API call, this plugin would be off by default in the Embed Everything plugin.

This would probably also require some filesystem caching to prevent continuous re-fetching in watch mode.

gfscott commented 8 months ago

🤔 Interesting. I suspect abstracting oEmbed might be overkill at the moment. For instance, the Soundcloud plugin uses @11ty/eleventy-fetch today to handle the API call and the filesystem caching, and constructing the oembed URL is pretty simple.

That said, I'm intrigued! I could see this making it easier to scale the number of supported services. Will ponder more.