In this page, I am going to go over building a personal page using Github and Rmarkdown.
If you want something simple and don’t want to put more than an hour on building it.
If you don’t want to spend any money.
If you know how to work with Rmarkdown.
If you have a Github account and fairly know how to use it.
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.
I assume you are familiar with how to do basic git, clone/commit/push.
I also assume you know how to use Rmarkdown.
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!
click here.
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.
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!
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.
Clone your website repository from Github. Put all the stuffs from step 2 in it. Commit! Push! Done!
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.