GitLab Pages is a service that allows users to generate static pages directly from the repository. It is an ideal solution for
- project or subject website,
- application documentation,
- simple user pages.
Only static pages can be run on this service. It does not allow you to run scripts or programs on the server side in any standard way. Therefore, it is not suitable for applications that require dynamic content generation, form processing, or asynchronous querying.
How to do it
Setting up a simple website requires setting up a repository in GitLab and configuring the CI to generate that website.
Select the appropriate namespace and project name
The project name is deterministically mapped to the name of the page where the project appears. In general, a project in GitLab with a path
https://gitlab.fi.muni.cz/ namespace/ [subns/…/]project.git
will be available at the URL
https:// namespace.pages.fi.muni.cz/ [subns/…/]project
Namespace user projects has
namespaceidentical to the faculty login, a
subns/…/is empty because the user namespace does not have subgroups. Therefore, for sites related to the project of a subject or research group, we recommend using the group namespace.
A special case is pages at the root of a domain. If you, as a user (or in a group), create a project with the same name as the subdomain, ie the shape
https://gitlab.fi.muni.cz/ namespace/ namespace.pages.fi.muni.cz.git
then the generated site will be placed at the root of the subdomain
The structure of the pages, the language used, etc. depends on the selected generator, ie the program that creates the resulting static website. Most support it
AsciiDoc, however, you can also find specific generators, eg for generating documentation from source code. You can also write your own generator.
- Get inspired by examples
look at official demonstrations repositories. Most of them can be used as a framework for your own project.
Pay attention to configuration files, it is often necessary to modify more than one configuration in templates. If the template has
README.mdor similar help, read it carefully.
- Tests the configuration
- We recommend that you start with a very small number of pages first to see if the generator works at all.
- Custom generator
- You can also use your own generator to generate content. Generation takes place like any other task for GitLab CI. For task setup requirements and where the result is expected, see official documentation .
CI / CD settings
You can use it to generate a site faculty instance of GitLab Runner or custom instance.
Don't forget to use the faculty instance
- set a tag for tasks
- verify that the container image for your chosen generator is available for the faculty GitLab CI, eg in application of faculty administration .
- set a tag for tasks
The website will be automatically accessible via the protocol
https with a certificate signed by the authority
Let's Encrypt .
The site URL can only be changed by moving the project. Otherwise, the path cannot be modified, not even administratively.
Website content from your own domain
For research groups or major projects, we can set up a proxy from the form domain
X.fi.muni.cz for providing content from GitLab Pages. We can also provide content from our own registered domain. All the registrar needs to do is set one of the following options for the domain:
doména in CNAME gitlab.fi.muni.cz.
doména in A 188.8.131.52 AAAA 2001:718:801:23a::50
Please note that CVT does not register domains outside FI.
Regarding the precise terms
first contact the administrator at
- Source repository in GitLab FI, which is a slightly modified template for Jekyll from official source .
- Generated sample from the same repository.
If you don't know how to handle your own site:
- Check the settings for GitLab CI
- Project → Settings → CI / CD.
- look at
.gitlab-ci.ymlin the sample solution
- This file contains job definitions for generating a website in a faculty environment.
- Check the output of the failing task
- Main page of the project in GitLab → CI / CD.