Posting xaringan presentation on blogdown



Hello there!
Fearing asking this on SO, I wanted to try the community first.

What's your workflow of publishing your xaringan slides on blogdown? I'm not the sharpest pencil in the box, and I'm not sure how to do it best within the blogdown environment.

I understand blogdown can't render the .Rmd file that is the xaringan presentation, so that leaves me with an .html file and a libs folder. Where do I, ahem, stick it?



Great little blog post by Tim Mastny on how to do just that: Embed Slides in Your Blog(down).

The gist (though it's short, so I recommend just reading the post):



On the blogdown demo site we link to how to render xaringan type Rmd files:

I will say I have found it easier to store my presentations in a separate repo then link to them from my site though. But, you can actually knit to moon reader from within your blogdown file structure, working in a directory other than contents/post.


Do you have a live example of this setup, please?


Sure I did it here:
Take a Sad Plot & Make it Better


OK I see what you did there. I did it the same way as I needed to publish the slides fast, so I just did the github pages thing:

But I thought there must be a better way, where I don't have to use 2 different domains.

I noticed the way @yihui has his slides published here:
His main website is, and the slides are at subdomain
I find this setup very cool, but I'm not sure how exactly to accomplish that in blogdown. I haven't found a tutorial on this.


My slides are hosted in a Dropbox folder via Updog: There is only one benefit of it: I don't need to explicitly upload slides.


Do you specify the argument height? When I use the default one 400px, the frame is too small to display the slides.


I've actually never done it myself (that's not my blog post), but, from the look of it, it seems like if you don't specify a height, it'll fit to the maximum width of the theme, and adjust the aspect ratio appropriately (adding margins if necessary). I'm guessing here, though, as (like I said) I haven't actually done it myself.


I use this all the time and have never had the problem are seeing, and never use the height argument. Examples here:

Rmd here: