In this page, I am going to go over building a personal page using Github and Rmarkdown.

Who is this for?

This is the best thing that I could find that doesn’t require you to pay for your domain and requires some elementary R skills.

I wanted a free domain (github.io). I didn’t want to use Jekyll (hated all the stuff that I need to install) which Github pages forces you to use and I know R! My page is the result…in less than an hour.

Step by Step procedure

Step 0: Prerequisite

I assume you are familiar with how to do basic git, clone/commit/push.

I also assume you know how to use Rmarkdown.

Step 1: Create a website repository on Github

Create a new Github repository by clicking here.

  • for Repository name, type username.github.io (for example, mine would be fredazizi.github.io).

  • Let it be a public repository.

  • Add a README file.

You are done!

Step 2: Clone my repository

  1. click here.

  2. Top right, click on code and pick one of the options that works the best for you to clone this repository.

Good! You basically need only two things from this repository for the most basic version of the site: index.rmd and _site.yml.

Step 2: Play with _site.yml and index.rmd and knit the index.rmd file.

Well, lets go over each one.

for _site.yml:

Title should change to your name (or something that you want to be the title). Under left, you can control the items (other sections) of your website (I wanted a notebook section and an app section and a cv section.), href would be the html page corresponding to that section that you will build with rmarkdown later. If you don’t want other section, just delete this part.

The output part can be omitted. Here you have the option to chose theme (which specifies the Bootstrap theme to use for the page). You have some options here, check this website, see the styles. highlight option only matters for the syntax highlighting style in rmarkdown which is irrelevant unless you want to put R output in your website.

index.rmd:

This is going to be front page of your website. I just wanted an introduction of myself. You can edit it to your liking!

  • Note: If you have other pages in your menu, you will need a rmd file with same name that you specified in _site.yml.

Now knit the rmd files. Here comes the weird part! A folder that is called _site will be created. You need to bring all of its content to the original main folder.

  • Note: When you knit, you can check your website locally. Make sure everything works!

Step 3: Create the website!

Clone your website repository from Github. Put all the stuffs from step 2 in it. Commit! Push! Done!

  • Note: Your website might take a few minutes to work after the successful push. So give it some time.

Future, helpful links/reads, etc

1- If you end up owning a URL, a much better choice for building a website using R would be blogdown package that is developed by the amazing Yihui Xie, Christophe Dervieux and Alison Presmanes Hill. The catch is that blogdown recommends using Netlify to deploy the website. See the book and this talk from Yihui Xie for more information.