rob-murray / jekyll-twitter-plugin

A Liquid tag plugin for the Jekyll blogging engine that embeds Tweets, Timelines and more from Twitter API
MIT License
238 stars 30 forks source link

tweet embed options not being passed #46

Closed psifertex closed 2 years ago

psifertex commented 2 years ago

I'm using the latest version 2.1.0 but I'm having trouble getting multiple options working:

{% twitter https://twitter.com/moyix/status/1486860078477156355 dnt=true width=350 conversation=none cards=hidden %}

Produces:

<div class='jekyll-twitter-plugin'><blockquote class="twitter-tweet" data-dnt="true"><p lang="en" dir="ltr">Wow, this looks like a big step forward for Binary Ninja! Congrats to <a href="https://twitter.com/vector35?ref_src=twsrc%5Etfw">@vector35</a>, I&#39;m looking forward to trying it out (especially the new Pseudo-C decompiler)! <a href="https://t.co/4GiBoS8NhP">https://t.co/4GiBoS8NhP</a></p>&mdash; Brendan Dolan-Gavitt (@moyix) <a href="https://twitter.com/moyix/status/1486860078477156355?ref_src=twsrc%5Etfw">January 28, 2022</a></blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>

Notice that the width, conversation, and cards options are not being passed.

If I manually replace the liquid with the HTML and add the data-conversation, data-width, data-cards fields, the embed works as expected.

fuzyll commented 2 years ago

If anyone comes across this in the future, these are the embed options you want: https://developer.twitter.com/en/docs/twitter-for-websites/oembed-api#Embedded. These will work and are part of the API this plugin uses under the hood.