Publishing your notes and books via bookdown in the github is free and easy. Here is my note for me to record how to do it.
Deploy bookdown in Rstudio:
Build a new project for bookdown from R studio in the folder, such as “~/Dropbox/sjin-blog/bayeslm”.
After your bookdown project is created, open ‘_bookdown.yml’ Files, then in the last line add:
Drop down Build button, and click Build All; You will see a “docs” folder inside the folder of
~/Dropbox/sjin-blog/bayeslm. The content of the bookdown page is then inside the
Possibly there is an error saying that packages.bib is not found. In this case, go to
/bayeslm/index.Rmdfile, you will see this line
bibliography: [book.bib, packages.bib]at 7th line; check if both files are in the folder of
/bayeslm. If there there is no
/bayeslmfolder, delete it and leave
index.Rmd. Alternative way is to create this missing file, such as copy
book.biband rename it to
packages.bibif you do need this bibliography.
Create an empty reopsitory in Github:
Create a new repository, for example named as “bayeslm”
Push local files into github
- Open a terminal, input the following codes:
$ cd ~/Dropbox/sjin-blog/bayeslm/docs $ touch .nojekyll $ cd .. $ git add . $ git commit -m "initial commit" $ git remote add bayeslm https://github.com/yourusername/bayeslm.git $ git push -u bayeslm master Username for 'https://github.com': your user name Password for 'https://firstname.lastname@example.org': your password
- After pushing files to Github, go to repository’s settings and under GitHub Pages change the Source as master branch /docs folder.
Within one minute, the website will be deployed at https://calebsjin.github.io/bayeslm/.