Last compiled: Thursday, March 09, 2017 - 13:38:45.

Prerequisites

This talk assumes you have the following installed on your machine:

or that you have access to the ASU RStudio server that has all of the above and more already installed. See Happy Git and GitHub for the userR for details on setting up the above on your own machine.

Note: If you are a MAC user, I recommend using the version of Git that is pre-installed with Xcode (https://developer.apple.com/xcode/). See the Mac OS section of Happy Git and GitHub for the userR for details.

Tips/Checks

To see the version of Git installed on your machine, open a shell and type:

git --version
git version 2.10.1 (Apple Git-78)

To find out where Git is installed on your machine, open a shell and type:

which git
/usr/bin/git

Make Sure Git Knows Who You Are

Type the following at the shell prompt:

git config --global --list
user.name=Alan Arnholt
user.email=arnholtat@appstate.edu
credential.helper=osxkeychain
color.ui=auto

If you have not configured at a minimum your user.name and user.email, substitute your name and email for mine in the code below.

git config --global user.name 'Alan Arnholt'
git config --global user.email 'arnholtat@appstate.edu'

Create a GitHub Account

Basic Web Page

  • Consider building a web page from these files

  • Upload the 12-website.zip file to RStudio (note where the 12-website directory is created)

  • Click on 12-website directory > click on the website.Rproj file, which creates an R project named 12-website.

  • Each web site you create requires a file neame _site.yml, which provides the global YAML header for the site, and a *.Rmd file named index.Rmd, which provides the content for the home page of your website.

Basic Web Page (Continued)

Basic Web Page (Continued)

  • Click on the Build Website button

Fork BasicWebPageA

Understanding the Set Up

The website created from the code in the repo BasicWebPageA and viewable at https://alanarnholt.github.io/BasicWebPageA/ consists of *.yml and *.Rmd files. The minimum requirement for any website is that it have an index.Rmd file as well as a _site.yml file. Consider the first nine lines of the _site.yml file.

name: "Basic Web Page"
output_dir: "docs"
navbar:
  title: "Your Name"
  left:
    - text: "Home"
      href: index.html
    - text: "bookdown"
      href: bookdown.html

Publishing on GitHub

There are several ways to publish your web pages on GitHub. For now, we will only consider publishing the docs directory. To publish the docs directory, choose the Settings icon on your GitHub repository.

GitHub Pages

Scroll down to the GitHub Pages box. Click on the drop down menu under Source and select master branch /docs folder

Building the Web Pages