parkerbxyz / redirect-github-pages

A proof of concept to manage redirects for GitHub Pages sites

Home Page:http://parkerb.xyz/redirect-github-pages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

redirect-github-pages

This template repository allows you to quickly and easily redirect GitHub Pages sites when their repositories are renamed or transferred from one user or organization to another.

Using this template

To create a redirect, you must first create a user or organization GitHub Pages site from this template:

  1. Click Use this template.
  2. Use the Owner drop-down menu, and select the account you want to own the repository.
  3. Name the repository username.github.io, where username is your username (or organization name) on GitHub.
  4. Click Create repository from template.

Creating a redirect

To create a redirect from one GitHub Pages URL to another:

  1. Create a new markdown file with the same name as old Pages repository you'd like to redirect from. (e.g. old-name.md)

  2. Add the following to the top of the new markdown file:

    ---
    redirect_to: <new-repo-url>
    ---

Example

You renamed your Pages repository from foo to bar and need to redirect username.github.io/foo to username.github.io/bar.

From your account Pages site repository (github.com/username/username.github.io), create a new markdown file named foo.md and add the following to the top of the file:

---
redirect_to: username.github.io/bar
---

Running locally

Install dependencies:

script/bootstrap

Run the server locally:

script/server

About

A proof of concept to manage redirects for GitHub Pages sites

http://parkerb.xyz/redirect-github-pages

License:MIT License


Languages

Language:Ruby 69.1%Language:Shell 30.9%