Skip to content

Instantly share code, notes, and snippets.

@zgulde
Last active March 26, 2020 19:29
Show Gist options
  • Save zgulde/75ba467d029d9bcfc3e484ea5178edae to your computer and use it in GitHub Desktop.
Save zgulde/75ba467d029d9bcfc3e484ea5178edae to your computer and use it in GitHub Desktop.

Publishing A Jupyter Notebook On Github Pages

In short:

  1. Download the notebook as an html file
  2. Make a repo on github with a specific name and push the html file to that repo

Walkthrough

  1. Get an html file to publish

    1. Restart the kernel and run the notebook from top to bottom
    2. From the jupyter notebook dowload as an html file
  2. Make a repo on github that will be your internet site

    Github Pages is a free service that github offers to host your websites. To get started:

    1. Create a repo on github named exactly yourusername.github.io (replace yourusername with your github username).
    2. Create a repository locally and wire it up to the one you created on github.

    Anything you push to this repository will be live on the internet at

    https://yourusername.github.io

  3. Add content and make the site live

    1. Copy over the html file you created from the notebook into the new repository.
    2. Name the html file index.html (whichever file is named index.html is the "landing page" for your site)
    3. Add, commit, and push the index.html file

You should now be able to see your site live!, go to https://yourusername.github.io/ to see it! (it might take 1-5 minutes after pushing for the site to update)

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