A Public-Facing Portfolio and GitHub Pages
Purpose: This notebook will help you create a public facing portfolio (a professional webpage) using GitHub pages. You can use this portfolio to share projects that you are proud of so that future employers or graduate programs can see what you are capable of. In particular, you’ll do the following.
- Create a
username.github.io
repository. - Enable this repository to use the Pages environment
- Add a theme to make your site look less plain.
- Organize a page using headings and free form text.
- Post projects you are proud of or are working on by either adding them to your GitHub repository, sharing them via Google Drive links, or allowing documents from other GitHub repositories to be posted by allowing pages to access their files.
Create a username.github.io
Repository
We’ll start by creating a GitHub repository dedicated to hosting your page. It is easy to manage this repository and page directly from GitHub, so you won’t create an R Project to manage it.
- Navigate to GitHub and log in.
- Click the green
New
button to create a new repository. - Important: You must name this repository
username.github.io
, whereusername
is replaced by your GitHub username. For example, the repository corresponding to my page isagmath.github.io
. - Click the checkbox to initialize your repository with a
README
file. - You can choose your preferred settings for the remaining fields – changing any of them is optional.
- Click to
Create repository
.
Enable your Repository with the Pages Environment
- Enter your new repository and go to
Settings
– you can find it in the grey banner at the top of the repository. You may need to use the triple-dot icon to accessSettings
. - In the navigation menu on the left-hand side of the page, locate the
Pages
tab and click on it. - Underneath Build and deployment, choose
Deploy from a branch
under the Source heading. - Underneath Branch choose either
master
ormain
and set the folder to/(root)
, which should be the default. Then clickSave
.
It may take a minute or two to deploy, but try navigating to username.github.io
(again, where username
is your GitHub username) and view your little corner of the web! Don’t worry, we’ll make it more exciting now.
Adding a Theme
Adding a theme is the quickest way to make your webpage look more professional. You can see the available jekyll-themes
here. Clicking on a theme will open up a repository, but if you scroll down to the README below the file listing, there is an explanation of the theme components along with a link to preview the theme to see what it looks like. Check out the available themes and identify one you like.
Once you’ve identified a theme you’d like to use, you are ready to add it to your page.
- Return to your
username.github.io
repository. Make sure you go to the actual repository rather than the public-facing webpage you’ve enabled. - Locate the
Add file
button to the left of the greenCode
button, click on it, and select toCreate new file
. - Important: In the
Name your file
box, you must name this file_config.yml
. - In the body of the file, you’ll add a single line
theme: jekyll-theme-theme.name
, wheretheme.name
is replaced by the name of the theme you’ve chosen in all lowercase letters. - You can add more items here to further improve your page if you like. For example, you can add a
title
, adescription
, enablegoogle_analytics
. The contents of my_config.yml
file are below:
theme: jekyll-theme-cayman
title: Welcome description: This is the homepage of Adam Gilbert, Associate Professor of Mathematics at Southern New Hampshire University. I am interested in data science, discrete mathematics, and developing open educational resources (OER). You'll find information on these topics as well as the courses I regularly teach scattered across these pages.
- Make any updates you like and then scroll to the top of the page to find the green
Commit changes...
button. Click on it, add a commit message to describe what you’ve done, and then click to confirm.
It may take another minute or so to push the changes to your public-facing site. Navigate back there to confirm that you’ve made the change.
Organizing Your Page Using Headers and Free Text
Good news! You construct your GitHub pages page using markdown syntax just like we’ve been using in our Quarto notebooks. You add headers with hastags (#) – more hashtags means lower-level headers. You separate paragraphs with an empty line in your markdown file. You can format italic text with single asterisks on either side, and bold text with double-asterisks on either side. You’ll pick up more techniques as you need them. Additionally, if you know any HTML, those tags are also usable here in your markdown file as well.
- Back in your
username.github.io
repository, you’ll see two files in your file listing –_config.yml
andREADME.md
. Click on theREADME.md
file to open it. - Use the pencil icon in the top-right corner of the preview block to edit your file.
- Change the name of the file to
index.md
instead ofREADME.md
. This will be helpful if you decide to structure your page as a full-on website (with multiple pages) rather than a single webpage. - Use what you know about markdown syntax to add a few sections to your page. Perhaps you’d like to include an About Me section as well as a section about your Goals and Interests and maybe even some sections about relevant research projects or coursework you’ve engaged in.
- If you didn’t add a
title:
ordescription:
to your_config.yml
file, you can add a page-specifictitle:
anddescription:
on any of your pages by using what you know about YAML headers. For example, at the top of yourindex.md
file, you may include the following:
---
title: Welcome
description: This is the homepage of Douglas Yancey Funnie, proud resident of Bluffington! ---
- Once you are done, again navigate to the top of the page and find the green
Commit changes...
button. Click it, add a commit message, and confirm.
Wait a few minutes and then navigate back to your public-facing webpage. Be proud of what you’ve created so far!
Adding Links and Files
You may remember from our discussions about Quarto that we can create hyperlinks by surrounding the link text in square brackets and providing the URL to the item on the web we want to navigate to in round parentheses immediately after the closing square bracket. For example, [navigate to my website](agmath.github.io)
would result in a hyperlink to my webpage where the displayed link text would be navigate to my website. You can use this same technique to share files with people who are landing on your webpage.
Summary
You’ve created a GitHub pages webpage for yourself. My hope is that you’ll continue to use this site as a professional portfolio which can be shared with prospective employers or graduate schools. You can even use it as a creative outlet.
There’s lots more you can do with GitHub pages. You can add pictures, build and use custom CSS files to make your page unique, and more. You’ll learn how to do things as you want to implement them – there are lots of resources on the web. The source for my GitHub page is public and is available here. There’s nothing super fancy, but you are welcome to steal whatever you like!