Questions:

Objectives:

Keypoints:

Github pages takes HTML files from a Github repository and publishes a website.

Note: Github is not the only option for hosting your code. Other services include Gitlab (which is an open source project) and Bitbucket.

We can create a simple website in three short steps

Important: You don’t need to select a license at this stage but it’s recommended that you do. The MIT License is a popular choice as it is simple and permissive (people do almost anything they want with your project). If you are not clear which license to use you can visit https://choosealicense.com/.

A branch in Git is similar to the branch of a tree. A tree branch is attached to the main part of the tree. While branches can generate and fall off, the main central part of the tree continues. Similarly, a branch in Git is a way of developing new features or fixing bugs without affecting the main part of the project (the main branch). The main branch is created when we create the git repository.

Important: Github pages will automatically publish any html on the gh-pages branch only.

    <!DOCTYPE html>
    <html>
        <head>
            <title>Hello World!</title>
        </head>
        <body>
            <p>Soooo nice to meet you.</p>
        </body>
    </html>

You can access your project webpages using the address format username.github.io/repository-name/filename.html. If you have followed the suggested naming in this example you can access your Hello-world webpage at https://username.github.io/website-example/Hello-world.html

Github pages can be combined with a variety of static site generators to create a customised website.

A single page project site is created using the README.md file on the gh-pages branch.

Note: Github will automatically convert a file named README.md on the gh-pages branch only if an index.html does not exist.

Github pages combined with Jekyll front matter can be used to create a multipage sites.

---
title: Code of Conduct
---

Welcome to the Build-your-own website page.

The first rule is: Be Nice!

Important: The three dashes at the top and bottom of your front matter are very important. If your file does not start with front matter in this format Jekyll will not convert the file to html.

Info: The Code of Conduct we use here is a silly example. However for many projects and initiatives having a Code of Conduct is important. There is more information on this page.

Github has a range of Jekyll themes to choose from.

Note: The theme will only be applied to the README.md or webpages with the Jekyll front matter.

Note: When you select a new theme the _config.yml file in your repository is automatically updated.

To access a wider range of customisation options you can fork a Jekyll template and edit the _config.yml file.

For more flexibility you can combine other static site generators can be combined with Github actions .

Note: the gh-pages branch in this example includes a .nojekyll file to tell Github pages not to automatically build it using Jekyll

TASK

Use Github pages and Jekyll to create an academic website. This could include:

Think of it as an online CV. It is a great way to promote your work to potential employers or supervisors.