Your repository and its website
The GitLab repositories you work in during the studio are more than a place to store code. A repository holds three things: your documentation, the applications you build, and a slide deck for your presentation. Every time you push to the default branch, GitLab turns the repository into a website and publishes it.
This applies to every repository in the studio that has a mkdocs.yml file in its root, whether it belongs to your learning group, your group project or only to you. Where these pages say your team, read: everyone who works in the same repository.
This section explains how that works and how you change it.
Your repository is published as a public website
Everything in the docs/ folder and in your slide deck is published to the open internet. Anyone with the link can read it, and search engines can find it. Do not put personal information, client-confidential material or API keys in there. Read What not to publish before your first push.
What is in the repository
| File or folder | What it is | Do you change it? |
|---|---|---|
docs/ |
The pages of your website, written in Markdown. Other files in here (HTML, images, JavaScript) are published unchanged. | Yes, all the time. |
docs/index.md |
The home page of your website. | Yes. |
mkdocs.yml |
The settings of the website: its name, colours, fonts and features. | Yes, for the look and feel. |
markdown-presentation/ |
Your slide deck (demo-slides.md), its images and its stylesheet (marp-custom.css). |
Yes, for your presentation. |
.gitlab-ci.yml |
The recipe GitLab follows to build and publish the website. | Rarely. Only when you rename your slide file. |
docker-compose.yml, Dockerfile, Dockerfile.marp |
Let you preview the website on your own laptop. | Rarely. |
requirements.txt |
The Python packages that build the website. | Only when you add a MkDocs plugin. |
engine.js |
Makes Mermaid diagrams work in the slides. | No. |
Two tools do the work:
- MkDocs with the Material theme turns the Markdown files in
docs/into a website. - Marp turns one Markdown file into a slide deck.
From push to website
You never upload the website yourself. You push your changes to GitLab, and a pipeline builds and publishes it for you.
A few things to know:
- Only the default branch is published. Work on another branch is built, so you can see whether it still works, but the website only changes once the work is merged into the default branch (usually
main). - It takes a few minutes. If you do not see your change, check the pipeline first and then refresh your browser with Ctrl+Shift+R (Cmd+Shift+R on a Mac).
- You share one website with your team. A push that breaks the build stops everybody's changes from being published until it is fixed.
Find your website and your pipeline
In your repository on GitLab:
- Deploy → Pages shows the address of your website. Your slides are at the same address followed by
/slides/. - Build → Pipelines shows every build. A green check mark means your website was built; on the default branch it also means it was published.
When the pipeline is red
- Open Build → Pipelines and click the red pipeline.
- Click the job with the red cross (
build_mkdocsorbuild_marp). - Scroll to the bottom of the log. The last lines almost always name the file and the problem.
The usual causes are a typing or indentation mistake in mkdocs.yml, or a slide file that was renamed without updating the pipeline. You can catch both before pushing by previewing your site locally.
I want to...
| I want to... | Go to |
|---|---|
| see my changes before I push | Preview your site locally |
| add a page, an image or a diagram | Writing documentation |
| change the name, colours or fonts of the website | Changing the look and feel |
| put my application online and link to it | Publishing your application |
| make the slides for my presentation | The slide deck |
| know what I should keep out of the repository | What not to publish |
Before you present
Remove the examples
The repository starts with example content: a demo home page, a linear regression explorer and demo slides. Use them to learn how things work, then remove or replace them. Leftover example material in a final product looks careless.
Related pages
- Learning Groups: what you deliver: what your learning group project and its documentation must contain.
- Learning Groups: presenting your work: what happens at the end of a cycle.
- Group Project: repository: how your project team commits its work.