Skip to content

Instantly share code, notes, and snippets.

@evanwill
Last active May 18, 2017 18:37
Show Gist options
  • Save evanwill/481774c1ef4cf727ca4b48a36a5edaef to your computer and use it in GitHub Desktop.
Save evanwill/481774c1ef4cf727ca4b48a36a5edaef to your computer and use it in GitHub Desktop.

Open Textbook on GitHub and gh-pages

Kris Shaffer, Bryn Hughes, and Brian Moseley, Open Music Theory, Hybrid Pedagogy 2014+.

Open Textbook =

  • open access: website
  • open source: GitHub repository
  • open license: cc-by-sa, you CAN copy, modify, and share it, as long as you attribute it and also openly license it.

Basically this open textbook is a Jekyll project, using Balzac theme, hosted on GitHub Pages. Thus:

  • content is written in Markdown.
  • static site generator (Jekyll) uses the theme to format the content into a web site.
  • site HTML is hosted by GitHub Pages.

Skills to make basic modification:

More advanced customization:

  • Git
  • Jekyll
  • html, css, js

My workshop pages:

Create clean copy of Open Music Theory

The Open Music Theory repository has been forked several times and worked on by many people. In this case a fork brings with it a lot of legacy code and odd configurations. I decided it would be better to create a fresh version to work with.

  1. Clone the original repository: git clone https://github.com/openmusictheory/openmusictheory.github.io.git

  2. Delete unnecessary files/directories:

    • .sass-cache
    • CNAME
    • Gemfile
    • Gemfile.lock
    • params.json
    • Graphics/form/.DS_Store
    • Graphics/protonotation/.DS_Store
    • Graphics/intervals/.DS_Store
  3. Create new personal repository:

    • On GitHub, click the plus icon on the right side, select "New repository"
    • Give the repository a good name (it will show up in the URL)
    • Check the box next to "Initialize with a README"
    • Click "Create repository"
  4. Clone the new repository to your machine

  5. Manually copy the Open Music Theory files to the new repository directory, except the .git directory (it should be a hidden folder). Once you copy them all, the original repo "openmusictheory.github.io" can be deleted.

  6. Fix the _config.yml file (in the new repository)

    • replace url with your gh-pages address, like: https://username.github.io/repositoryname
    • replace baseurl with ""
    • replace or delete the owner information
    • delete the tools section
    • delete timezone, future, pygments, markdown, kramdown, sass
    • delete include, exclude
    • my config.yml for reference
  7. Fix .gitignore file. Delete everything on it, and paste in:

_site
.sass-cache
.jekyll-metadata
  1. git add, commit, and push all the changes!

    • git add -A
    • git commit -m "clean Open Music Theory"
    • git push
    • my repo for reference
  2. Activate gh-pages to create the website:

    • click on repo's "Settings" tab
    • scroll down to "GitHub Pages" section
    • under "Source" use dropdown to select "master branch"
    • click "Save" button
    • wait for the site to build! my version
  3. Update the README.md and index.md to make it clear you forked this work and are now customizing it yourself.

p.s. rather than following this, you can "import" my cleaned repository by clicking GitHub plus icon, selecting "Import repository", then paste in the clone link https://github.com/evanwill/open-music-theory.git . Unlike a clone, this will give you a fresh repository.

Jekyll theme demo

In open-music2, I deleted out the original "Balzac" theme files and replaced them with the Ed theme. The result is open-music2 website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment