eleventy-plugin-embed-everything icon indicating copy to clipboard operation
eleventy-plugin-embed-everything copied to clipboard

Feature request: SlideShare support

Open RReverser opened this issue 2 years ago • 4 comments

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.

RReverser avatar Jan 03 '24 00:01 RReverser

[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:

  • URL: https://www.slideshare.net/gorvis/mba-presentation-30271863
  • Embed: https://www.slideshare.net/slideshow/embed_code/key/46OBIIyT1ZcBaw
  • oEmbed API URL example: https://www.slideshare.net/api/oembed/2?url=https://www.slideshare.net/gorvis/mba-presentation-30271863&format=json

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

gfscott avatar Jan 04 '24 16:01 gfscott

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 avatar Jan 04 '24 17:01 RReverser

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.

RReverser avatar Jan 04 '24 17:01 RReverser

🤔 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.

gfscott avatar Jan 04 '24 21:01 gfscott