DCU Library | Digital Humanities Workshops | Build a Website with Github Pages

Git, GitHub, & GitHub Pages

To begin we’ll look at these things called Git, Github and Github Pages and how they all inter-relate.

1. Git

Git Logo

Git is a distributed version control system.

That is, a piece of software used to track the history of changes in a file or a set of files. In Git, this set of files is known as a repository.

It helps avoid multiple versions of files and ending up with something like…

“Piled Higher and Deeper” by Jorge Cham

We won’t be diving too much into Git or Github’s version control functionalities here as we are just using it to host a website. If you are interested in learning more about that aspect try our workshop on Version Control. There is also a good introduction to this on GitHub’s Hello World guide.

Git has its own terminology for various functions - branching, forking, cloning etc. - which can be a little off-putting if you haven’t used it before. In this workshop we’ll only deal with what we need to know for the purposes of creating our website.

Git repositories can be created and managed locally, on your personal computer, or by online services, such as…

2. Github

Github Logo

GitHub, a popular web platform for hosting Git repositories - i.e. a place to store and sync your project files online.

It provides a handy web interface for managing, editing, and collaborating on repositories.

Github was designed to manage large open-source software projects, but its use has expanded to many other types of organizations and individuals, with over 40 million users. GitHub provides lots of additional project management features and functionalities, one of which is…

3. Github Pages

Github Pages Logo

GitHub Pages, is a free static web hosting service available as part of every repository.

Initially this catered for technical blogs or project documentation but it offers a good solution for open educational resources or collaborative research project sites that may not fit on your institutional domain.

Many organizations and individuals are using GitHub to collaboratively create and publish public websites. For example, Programming Historian, The Carpentries, or this site!

📌 There are limits and guidelines for websites hosted on github pages:

  • site content < 1GB
  • < 100GB bandwidth per month
  • < 10 builds per hour If your site exceeds these quotas, GitHub will send a notice asking to modify the repository.

📌 All content must follow the community guidelines, e.g. no violence, obscene, or illegal content.

Practice Time!

Let’s create a new repository, then write some Markdown to see how Github Pages works.

1. Create a New Repository

Your new repo contains one file, README.md. Before we do anything else we’ll turn on the Github Pages setting.

2. Activate GitHub Pages

Github Pages Settings Screenshot


README.md

:pushpin: You will notice that by default the contents of the README.md file are displayed on the home page of your repository.

This is a convention in code projects. README introduces your repository so anyone looking at it will understand what it contains, who made it, and any other information they should know. On GitHub READMEs are usually written in Markdown (denoted by the .md extension).

Markdown

:pushpin: Markdown is a lightweight markup language designed to simplify writing content for the web. We’ll be using it in most of this workshop to build up the content in the site.

There are excellent starter guides:


Let’s have a go at writing some Markdown…

3. Edit your README using Markdown:

# Project Title Here

This is a test repository for learning about github pages.

## Anything else?

I'm learning about **markdown** right now.

### Is that it?

Any text with no empty lines between will become a paragraph.
Leave a blank line between headings and paragraphs, or where you want to start a new paragraph.

Font can be *Italic* or **Bold**.
Code can be highlighted with `backticks`.

Hyperlinks look like this [GitHub Help](https://help.github.com/).

A bullet list is created using *, +, or - like:

- dog
- cat
- muffin

A numbered list is created using a number followed by '.', like:

1. one
2. two
3. three
4. four

You can do 'compressed' content like this:

<details>
<summary> My favourite numbers are</summary>

- one
- two
- three
- four

</details>


:pushpin: Commit is a git concept–basically taking a snap shot of the changes that will be permanently stored in your repository’s history. Every commit records a user name, email, and message.


Once you commit, you will immediately see your README updated content rendered on the page. Behind the scenes GitHub is converting your Markdown code into HTML for display.


References

:pushpin: Git & GitHub:

:pushpin: Markdown:


💡 Key Points:

✅ Git is a version control software.

✅ Github is a web platform for hosting Git repositories.

✅ Github Pages allows you to turn any repo into a website.

✅ Content in Github can be written in Markdown, a lightweight markup language.

✅ You update repositories by making commits.

Back
Next