github-pages

From IndieWeb
Jump to: navigation, search


GitHub Pages is a static content hosting service.

Contents

GitHub's GitHub Pages (gh-pages) feature is a static domain hosting where you can host your static sites. They offer pre-built web page templates, as well as the ability to build and host Jekyll websites.

Why

Static content hosting is a form of web hosting that can be used for getting started on the IndieWeb.

Advantages

  • An advantage to using a GitHub based solution is that you can easily transfer it to another web host simply by deploying from GitHub to your web host.

How

Easy Start

The simplest way to get started with GitHub pages is:

Guides

There are several more involved guides on how (and approaches) to use GitHub Pages to host your website:

Fork and go

Some websites provide ready-to-fork repositories that one can use to get started. These *don't* have to be used with GitHub, but they are configured to use GitHub pages by default.

  • Octopress provides a rich website construction toolkit, based on top of Jekyll.
  • pjf.id.au has his entire website under CC-BY, with a branch on github specifically for forking the design and build process. Like Octopress, it uses Jekyll underneath. See the github repo for details.
  • coisas is a browser-based CMS that works only with GitHub Pages, it has a template that can be forked from the website UI, and then worked on without need of ever touching the command line.

IndieWeb Examples

Examples of IndieWeb sites hosted on Github Pages

Limitations

No HTTP Status Code Control

gh-pages does not allow you to setup custom HTTP [status] return codes. -bret (in IRC 2013-176, unlogged).

If a page exists, GitHub Pages will return "200 OK"

If a page does not exist, or was deleted, GitHub Pages will return "404 Not Found"

For some as yet unknown reason, GitHub Pages will return a 301 redirect to the same URL on the first request to a page in a "while". On subsequent requests, it will return the actual page content.

There is ongoing discussion on using http-equiv codes to work around limitations like these. See: deleted#Brainstorming

Limited file types

GitHub isn't a very good host for large media files, especially if they change, although there is nothing stopping you from uploading media. Only serve files from gh-pages, as raw repository links have to come out of some application layer, and thus are slower to retrieve. Github enforces a soft repository size limit of about 1Gb.

Jekyll Safe Mode

If you wish for GitHub to build your Jekyll website for you on their server, you must conform to the restrictions associated with jekyll safe mode, which means no plugins. You can pre-process with as many plugins as you want and upload raw html files instead as a simple workaround (similar to how octopress works).

No SSL on your own domains

While GitHub Pages supports shared SSL for pages under the *.github.io domain, it does not support using your own SSL cert for your own domain. A workaround for this is to serve the *.github.io website through CloudFlare and use their SSL certificate.

Criticism

As Github Pages is part of Github, it suffers from the same weakness - see the Github page for details about them.

See Also

Personal tools
Namespaces
Variants
Actions
Recent & Upcoming
Resources
Toolbox