Introduction to GitHub Pages

GitHub is a cloud Git repository hosting service, with benefits! It provides a handy web interface for managing, editing, and collaborating on remote Git repositories. Originally designed to manage large open-source software projects, its use has expanded to many other types of organizations and individuals, with over 20 million users. Accounts are free for public repositories–private repositories are available on a subscription pricing model.

github octocat

One amazingly useful GitHub feature is GitHub Pages. It provides free static web hosting from any repository. Gh-pages is intended to host relatively simple sites for your GitHub portfolio, project, or documentation. Because it is free and a valuable transferable skill, this is a great option for teaching and learning.

Many organizations are using GitHub to collaboratively create and publish public websites. For example:

Note: gh-pages features and setup have recently changed, so tutorials and documentation more than six months old are probably inaccurate. There are soft limits and guidelines for gh-pages usage: sites should be < 1GB, use < 100GB bandwidth per month, and make < 10 builds per hour. If your site exceeds these quotas, GitHub will send you a notice asking you to modify the repository. All content must follow the community guidelines, e.g. no violence, obscene sex, or illegal stuff.

Static Web

Unlike WordPress or Drupal, gh-pages is not a content management system or dynamic web application. There is no database, server side language / processing, or admin interface. This is known as a static web host. HTML, CSS, and JS stored in the repository are served to the user without dynamic changes.

In the olden days static web was the norm, but database driven dynamic web sites have dominated the last decade. Dynamic web applications enable features such as live comments, user authentication, and personalized streams. However, this functionality requires complex server-side infrastructure and processing.

Despite their limitations static sites are experiencing a new boom, because they offer some significant advantages:

To make development easier, hundreds of static site generators have sprung onto the scene (see lists at StaticGen and Static Site Generators). Static generators bundle together a stack of web development tools which are used to transform a directory of source code into a deployable web site. Jekyll is one of the most popular and actively developed, in part because of its integration with gh-pages.

Static Site Generators typically feature: command line interface; builtin development server; simplified markup based content; web templating language; CSS preprocessor; file-based data options; plugin extensibility.