For a project repo, your supervisor has often already created your team’s repo from the template. In that case, this tutorial does not concern you: go straight to Publishing your site with GitHub Pages.
The vocabulary, before you start
If this is the first time you have touched GitHub, two words come up
constantly in this tutorial:
- Repo (repository): a folder tracked by Git,
hosted on GitHub. It is the equivalent of a shared folder, but one that
keeps the history of every change.
- Template: a repo that serves as a starting point. The
“Use this template” button creates an independent copy for you, not a link
to the original.
This whole tutorial is done in your browser, on github.com: nothing to
install. Getting the repo onto your computer and editing it with
VSCode comes right after, once the site is published.
What you are going to do
The MakerSpace template-project
repo already contains the basic structure of a project: a
docs/ folder for the documentation site and a project/ folder for your
project files. You are not going to modify this template: you are going to create
your team’s repo, an independent copy that you can
change freely, without ever affecting the original.
This template is not an empty skeleton: it is a complete example
project, to be replaced by your own. That replacement is the subject of the tutorial
Customising your project template.
The MakerSpace portfolio-template
repo contains a ready-made personal site: home page, “Qui
suis-je” (about me) page and CV, projects, logbook, documentation and skills
radar. You are not going to modify this template: you are going to create
your own repo, an independent copy that will become your site.
This site is filled with example content (one project, one article and one
documentation page), which you will replace with your own over the course of the workshop.
Creating the repo
Step 1: Open the template
Step 2: Click "Use this template"
At the top of the page, on the right, there is a green Use this template button. Click it, then choose Create a new repository in the small menu that appears (not the other options).
A form is displayed, with several fields to fill in:
- Owner: your personal account (already selected by default), or the MakerSpace organisation if your supervisor asked you to.
- Repository name: the name of your project, in lower case, words separated by hyphens, with no spaces or accents: for example
robot-tri-dechets, not Robot de Tri des Déchets.
- Description (optional): a sentence summing up the project.
- Public / Private: leave Public, selected by default, unless your supervisor explicitly asks you otherwise.
- Owner: your personal account, already selected by default. Never an organisation: this site is yours.
- Repository name: it must be
username.github.io, where username is exactly your GitHub account name, the one shown in Owner. If your account is called firstname-surname, the repo is called firstname-surname.github.io, and your site will be online at https://firstname-surname.github.io.
- Description (optional): for example “Portfolio of First name Surname, engineering student at UniLaSalle Amiens”.
- Public / Private: Public, without exception. A portfolio is made to be seen, and GitHub Pages only publishes public repos for free.
It will appear on your CV, your LinkedIn profile and your internship applications. If your GitHub username is not presentable (xXdarkgamerXx), change it before creating the repo: on GitHub, your profile picture at the top right, Settings, Account, Change username. A simple name like firstname-surname is ideal.
Once it is filled in, click the green Create repository button at the bottom of the page.
Step 4: Check
You are redirected to your new repo: the URL in the address bar now contains your account and the name you chose, and no longer Makerspace-Amiens/.... The same files as the template appear in it.
Checking that everything is in order
- The
docs/ folder does contain index.md, _config.yml, the pages objectifs.md, equipe.md, etudes.md and tests.md, as well as the conception/, fabrication/ and journal/ folders.
- The
project/ folder contains the sub-folders mcad/, ecad/, firmware/ and software/.
- At the top of the page, the name of your repo is displayed, not “template-project”.
- At the root:
_config.yml, index.md, about.md, projets.md, blog.md, docs.md and competences.md.
- The
_projets/, _posts/, _docs/, _data/ and assets/ folders.
- At the top of the page, the name of the repo is exactly
username.github.io, with your username, the same as the one shown just before the slash.
The repo you have just created is a completely independent copy. Any change you make in your repo never affects the original template, and vice versa.
Troubleshooting
| Symptom |
Likely cause |
Solution |
| No “Use this template” button visible |
You are not on the template repo, but on a copy |
Check the address: github.com/Makerspace-Amiens/template-project or github.com/Makerspace-Amiens/portfolio-template |
| Portfolio: “The repository already exists” |
You already have a username.github.io repo on your account |
Delete it if it is empty or useless (Settings, right at the bottom, Delete this repository), or ask your supervisor for advice |
| Portfolio: the name of the repo does not match your username |
Typo, or username changed after creation |
Settings, General, Repository name field: rename the repo to username.github.io, with your exact username |
Exercise
As a team: create your project repo right now if it has not
been done already, and check that each member of the team can open it on
GitHub.
Create your username.github.io repo right now, and note its
address: you will submit it with that of your site at the end of the next
tutorial.
Next step: put your site online with
Publishing your site with GitHub Pages.
Photo credit: “a computer screen with a bunch of code on it” by Chris Ried, via Unsplash, under the Unsplash licence.