Publishing your website via github pages

Publishing your webpage as a github page

Workflow

This workflow sets up your quarto page as a github page. Please also refer to the resources below!

  1. Create a repository on github first! The name of the github repository needs to be .github.io (see step 1 https://pages.github.com/) The repository needs to be public.
  2. Copy the link that github provides immediately after you create the repository
  3. Clone the repo to your computer by using Rstudio. Open Rstudio, go to “create new project” –> choose “version control: git” –> enter the github url you just copied in there
  4. Copy paste all files over from your website R project into the newly created R project folder. Restart Rstudio, reopen the Rproject and check for the git pane to see whether it worked (it should show a “git” pane in the window where the environment pane sits))
  5. Open the “_quarto.yml” file and change the output-location to “docs” (see resources below, and the _quarto.yml file for my website for an example)
  6. Render all your .qmd documents for your website. Check whether they appear in the /docs folder
  7. Add an empty file called “.nojekyll” to the /docs folder (the . at start is important!)
  8. Go to the git pane within Rstudio, and push all files to the git repo. They should now appear when you look at the online repository on Github
  9. Go to your online github repo (within your browser): go to settings –> pages –> set branch to /docs
  10. Your site should be live. Go check..

Resource for step 1 (only do step 1 of this)! https://pages.github.com/

Resources for step 2 - 4: https://happygitwithr.com/existing-github-first.html

Resources for step 4 - 9: https://quarto.org/docs/publishing/github-pages.html#render-to-docs (only do the “render to docs” part)