Nick Knauer
Nick Knauer

Reputation: 4243

Publish Website made from R in Github

I created a website (html file) using the rmarkdown::rendersite() function in R. It works really well but it is just an html file.

How do I deploy this to github or another public server for me to make a publicly accessed url out of this?

My current github repository is here: https://github.com/nknauer/first_website

So far, I created a repository on github and followed the tutorial available here. However, I still couldn't make it into a webpage.

I guess the main question I'm asking is: has anyone tried this tutorial and successfully deployed a webpage (not just an html file) through github and are there other ways to do this from Rmarkdown?

Thanks!

Upvotes: 0

Views: 246

Answers (1)

Dirk is no longer here
Dirk is no longer here

Reputation: 368231

In brief, here is one way:

  1. Create a html file
  2. Create docs/ directory
  3. Go to settings and enable the docs/ directory.
  4. Place the file there in docs/. You are done.

One example is eg this web page corresponding to this file based on this vignette directory.

Moving the files around is simple too; you could use Travis or other means. An older approach used a separate branch gh-pages, but the current form is simpler.

Upvotes: 2

Related Questions