Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embed a tweet in a blogdown post

I want to embed a tweet with an image. When I embed a tweet on a blogdown post using shortcodes it does not appear in the twitter style

For example using the shortcode:

{{< tweet 989470885475008512 >}} 

I get an output (my blogdown uses the academic theme)

enter image description here

rather than this (as shown in the blogdown guide)...

enter image description here

Is there a way to override this behavior to get the appearance like this second example or to embed a tweet following the dev titter guidelines (which when I paste the html code in gives output like the first image above).

I am guessing, but I think the loss of twitter style in the embedded tweet restricts the possibility to embed a tweet with an image (it gives similar output to the first example along with the image url).

UPDATE

This is a browser (Firefox) issue (as suggested by @hplieninger). The twitter style appears when viewing the page in Chrome.

like image 367
guyabel Avatar asked May 01 '18 23:05

guyabel


2 Answers

Try this:

```{r echo=FALSE}
blogdown::shortcode('tweet', '989470885475008512')
```

Should work.

like image 97
lcgodoy Avatar answered Oct 20 '22 19:10

lcgodoy


Instead of copying the id of the tweet, simply click the drop-down icon at the top-right of the tweet, then select "Embed Tweet", copy the code and paste it into your markdown post. Go to your browser and you should see the effect.

enter image description here

like image 32
Peoray Avatar answered Oct 20 '22 21:10

Peoray