Convert: Course From Pre-W19
Converting a pre-W19 repo to a course repo
The pre-w19 format did not have a distinction between course level and offering level repos; everything was together.
So, to create an course repo for the new format, you have to disentangle the parts of the parts of the old repo that now go at the offering level from those that belong at the course level.
The first step will be to follow the steps for creating a new course level repo from scratch (those are on another page).
Then proceed with the steps below.
Step 1: The course level repo should already exist, so clone it.
git clone
it into a directorycd
into that directory
Step 2: Add a remote for the old repo, and pull in its contents
For example, from inside the directory for the new repo, add a git remote for the offering repo you are copying from. For example:
git remote add OLD git@github.com:ucsb-cs16/ucsb-cs16.github.io.git
Then pull in that repos contents:
git pull OLD master
If you have time to do the next steps now, don’t push just yet. We want to get a working site first.
Step 3: Copy in the updated boilerplate
Follow instructions to Copy in boilerplate files. They all go in the root directory of the repo. Do this even if those files are already there; you want to get the latest versions.
Step 4: Make updates to the _config.yml
that are “for all repos” first.
You should make these updates to the _config.yml
.
Step 5: Change these things specific to moving from pre-w19 repos for course offerings
- Find the
collections:
item in the_config.yml
.
For each collection that is usingtopic
as thelayout
, change this todefault
. - Look for the
include:
line. If it not present, add the following line:include: [`_pages']
If it is already present, you should add
_pages
to the existing list using one of the acceptable YAML syntaxes for lists.An alternative equivalent syntax for this is as follows. If there is an
exclude
key, it is good style to group these together.include: - _pages
- Follow the instructions from *
_config.yml
instructions for course repos specifically for these keys:-
url
,baseurl
,github_url
For example:
url: https://ucsb-cs16.github.io baseurl: "/" github_url: https://github.com/ucsb-cs16
-
title
,course
For example:
title: "UCSB CS16" course: "CS16"
-
Step 6: Review the general instructions for _config.yml
for offering repos
Most of the items in these instructions are likely now already taken care of, but just in case, review these and make sure that all the values look reasonable.
Step 7: OPTIONAL: Try running ./setup.sh
and ./jekyll.sh
This step is optional, but recommended. Skip it only if you don’t have the necessary software set up on your computing environment for [RVM](/topics/rvm/
Try running ./setup.sh
and ./jekyll.sh
to test the site locally.
Note that the localhost url will have the offering at the end of it. The trailiing slash is important.
for example:
- Correct: http://127.0.0.1:4000/w19/
- INCORRECT http://127.0.0.1:4000/w19
- INCORRECT http://127.0.0.1:4000
Check that the site appears to be operational and that there are no error messages when building the site.
If it looks ok, push your changes to github, and check the site online.
Related topics:
- Setup: —Setting up a new course repo in this format
- Setup: Boilerplate—Files that you just copy directly
- Setup: Migrate Offering from previous offering—The most common case: copying from an existing offering in this format (e.g. F19 → W20)
- Setup: New Course—Setting up a new course level repo in this format
- Setup: New Offering—Creating a first offering of a course