Our World in Data embed

I just embedded an Our World in Data graph into Edition and quickly came upon the realisation that a specific embed for Our World in Data would be desirable. Here’s my reasoning.

First off, I realise that there can’t be an embed for every service out there, which is why there’s the “Other…” option. One problem is that for some reason the “Other…” option doesn’t seem to work for Our World in Data graphs. Not necessarily a bad thing, as once can just embed the <iframe> into an HTML card. Problem here though is that while “Other…” embeds automatically allow one to add captions to embeds, HTML cards don’t. Adding captions to an Our World in Data HTML embed would be “easy” enough for those who know their way around coding (who could then create a re-useable framework with snippets), although this wouldn’t be doable for non-coders. Not a must have, but since Our World in Data graphs are inherently information-centric it could be useful to have a caption option available in order to give a more targeted description (exclusive from the post’s regular content).

Secondly, I noticed that Our World in Data <iframe>s have their width set to 100%. However, when inserting the <iframe> with an HTML card the width of the graph defaults to what can be described in Image embed parlance as Regular width (max 720px, for Edition at least), and without fiddling around with code there’s no way to change that width to the Wide setting (max 1200px, again for Edition). Were a full-on Our World in Data card created the option for Regular, Wide and Full widths could be included in the setup (as is done with Image cards), advantageous since seeing an information-dense graph in a larger frame could be beneficial introspection-wise. (The Full setting could very well be absurdly large, but to each their own).

Again, I realise that specific embed options can’t be created for every service out there. But while YouTube cards already exist due to YouTube’s pervasiveness, Vimeo cards nonetheless also exist in Ghost. However, just because there’s two embed cards available for videos (two and a half if you want to count Soundcloud embds, three if you want to count Twitter embeds), there’s no embed option for graphs. None of that implies that an embed card should be created for Our World in Data or any other graphing/data service. But due to the fact that Our World in Data graphs are now quite pervasive and whose recognition stands out amongst the non-scientific crowd (i.e. the general public), the fact that Our World in Data graphs are not only licensed under a Creative Commons license but whose underlying software is also open source (as opposed to all the proprietary other options out there), it would seem that Our World in Data would be a good fit for Ghost, supposing an option for graphical embeds was to be made possible.

That’s a slight misconception. There are no specific embed cards in Ghost currently, there’s just one embed card and the “specific” cards you mention are only icons for the most popular/universal services used for embedding, underneath they are all the same card. Every embed goes through an oembed service which fetches the HTML from the 3rd party site, with the 3rd party site being in control over the eventual output.

It’s not to say that given enough demand specific embeds for certain services couldn’t be added, but that’s a big departure from the current status-quo and every specific embed adds to on-going maintenance.

1 Like

I completely understand what you’re saying & love that you’ve put so much effort into making a proper case for the feature you want to see - so many people barely even explain and that makes it so hard for us, so I am very appreciative.

However, to build on what Kevin has said…

It sounds like this is the real heart of the issue - they possibly need to add OEmbed support? I searched their organisation and it looks like all references to oembed are things they use rather than provide.

Perhaps this is something you could raise with them - and then there’s twice the chance that the two projects will end up working together nicely.


First off, my bad, I failed to put two and two together and realise that pasting a Twitter link or what have you directly into the editor to automatically create an embed implied that all the branded embeds are effectively the same thing. Otherwise, with all of the clarification (thank you!) I went ahead and raised an issue on an Our World in Data repo (hopefully the right one).

In the meantime, for those who don’t know code (and may search the forum for this issue in the future) I should have added to my original comment above how one would set up customised HTML cards for Wide/Full Our World in Data embeds, with captions. In the example below, just replace wide with full if you’d prefer a Full embed rather than a Wide embed, and you can remove the class="kg-width-wide" portion entirely if you’d like it to be of Regular size. Likewise, you can remove the <figcaption>Lorem ipsum dolor sit amet.</figcaption> portion if you have no desire to add a caption.

<div class="kg-width-wide">
    <iframe src="____"></iframe>
    <figcaption>Lorem ipsum dolor sit amet.</figcaption>