Basic Setup: W19 and later

Basic Setup for a new course

Designed for Github Pages

This format is designed to be used with Github Pages, a web publishing service integrated with Github.

Some advantages of Github pages:

Do I have to use Github pages?

No. You can use the format described here, and still host the pages anywhere. For instance, you could still host the pages on the UCSB CS department webserver. That’s also an option you can use if/when there is a (rare) github.com outage.

To publish the site to, for example, https://cs.ucsb.edu/~cs111, you would

The catch is that you would then need to do this again each time you make changes to the Github repos. That could get onerous. It may be possible to do some automation of that step; but to be honest, that’s what Github Pages has already done. So unless there is a compelling reason to NOT use Github pages, that’s the recommended approach.

Organization, Main Repo, Instance Repo

For each course website (e.g. ucsb-cs8, ucsb-cs24, ucsb-cs111, etc.), we do the following:

Tying it together: _data/navigation.yml

To the end user (i.e. the student) the website appears as one seamless website. This is accomplished by keeping the navigation consistent. The file _data/navigation.yml allows the instructor to customize the global navigation for site and keep it consistent. (We’ll describe those details later.)

Summary

A course website in this format is

Github Repo URL Description
https://github.com/ucsb-cs56/ucsb-cs56.github.io https://ucsb-cs56.github.io Material that goes with the course permanently, e.g. lessons, tutorials, etc.
https://github.com/ucsb-cs56/f18 https://ucsb-cs56.github.io/f18 Material that is specific to a particular quarter and instructor, e.g. syllabus, homework assignments, labs, exams, seating charts, etc.

When transitioning to a new quarter, a new repo is created for that quarter, e.g.

Github Repo URL Description
https://github.com/ucsb-cs56/ucsb-cs56.github.io https://ucsb-cs56.github.io Material that goes with the course permanently, e.g. lessons, tutorials, etc.
https://github.com/ucsb-cs56/f18 https://ucsb-cs56.github.io/f18 Material that is specific to a particular quarter and instructor, e.g. syllabus, homework assignments, labs, exams, seating charts, etc.

When setting up a brand new course for the first time, you’ll create one new github organizations, e.g.

All of the repos for websites for that course will go into this organization. For example:

If there are multiple instructors teaching multiple instances of a particular course in a particular quarter, the naming convention is to add the instructor’s last name, e.g.

If there are multiple sections of a course with the same instructor in the same quarter, the lecture section day or time can be used to differentiate, if separate websites are desired.

You should add a .gitignore file customzied for Jekyll based on these instructions: /topics/gitignore/

Setting up the main course website (e.g. ucsb-cs111.github.io)

You should now have a course organization (e.g. ucsb-cs111) and an empty course repo (e.g. ucsb-cs111.github.io)

You should use an exisiting course repo as a model, e.g. https://github.com/ucsb-cs48/ucsb-cs48.github.io

We’ll go over the files you need, one at a time.

Plumbing for Jekyll/Github

The following files are ones that you should copy over “as is”. They only need to be updated if/when the preferred Ruby version changes (e.g. from 2.5.1 to a later version). While I’ve specified the purpose of the files below for documentation, you don’t need to look into those details at this moment unless you really want to.

| File to copy | Purpose | |--------------|---------| | `Gemfile` | This is needed for any Ruby application; it specifies the version of Ruby you are using, and what Ruby gems your application depends on. | | `.gitignore` | This helps keep your repo tidy by telling github which files to ignore when committing to github | The following additional file are needed only for running locally, and/or testing the site. You can get by without them, but they are highly recommended. | File to copy | Purpose | |--------------|---------| | `setup.sh` | This is a shell script that does the `bundle install` step for setting up Ruby to run locally for testing purposes | | `jekyll.sh` | This is a shell script that does the `bundle exec jekyll serve` step; if you run `setup.sh` once, then you can run this script to test updates to your website locally before pushing to Github. | | `.travis.yml` | Allows you to set up automated testing via <https://travis-ci.org>; this runs tests and help you find and debug configuration errors in your site as it's pushed to Github Pages. |

Configure the basic information for your course in _config.yml

Setting up the _config.yml is such a crucial topic, that we have factored it out into its own page here: /topics/config_yml

This is where you’ll set most of the defaults for your course.

Example:

course: "CS111"
qtr: "F17"
quarter: "Fall 2017"
...

Create index.md (home page)

A minimal _index.md looks like this for a main course website:

---
title: UCSB CS111
---

# &mdash;

And like this for a course website:

---
title: UCSB CS111 W19
---

#  &mdash;

Related topics: