OHI-Science/ohi-science.github.io

How to edit OHI+ websites

Opened this issue · 1 comments

New OHI+ websites use RMarkdown and GitHub, and can be updated with the same workflow that we use for OHI score calculations.

This short tutorial about how to work with RMarkdown websites is a good place to learn how to update your website. However, unlike the tutorial, you will have more than on 'branch' on GitHub: a master branch where you have your data and models, and a gh-pages branch that is the website. Here's what you'll need to do:

First time only:

  1. open RStudio, and notice how it says 'master' in the git tab. You are on the master branch.
  2. pull from the master branch
  3. click on the little cog-wheel, and select 'shell'
    image
  4. in the shell, paste or type git checkout gh-pages. This will pull the gh-pages branch to your computer, and present it.
  5. back in RStudio, notice that it now says 'gh-pages' on the git tab. (If it doesn't, click on a different tab and then back to the git tab to refresh)
  6. Make changes to your website like in the RMarkdown websites tutorial
  7. commit, pull, push as normal.

All other times
After that initial time in the shell where you told git that there was another branch you wanted to be able to access, it will be available to you as an option in RStudio. You can switch back and forth but be sure to save, commit, pull, and push to one branch before switching to another.

image

We're developing a toolbox-training chapter on this as well, with more information:

http://ohi-science.org/toolbox-training/websites