debian-mirror-gitlab/doc/user/project/pages/getting_started_part_one.md

104 lines
4.7 KiB
Markdown
Raw Normal View History

2018-03-27 19:54:05 +05:30
---
2019-09-04 21:01:54 +05:30
last_updated: 2018-06-04
type: concepts, reference
2018-03-27 19:54:05 +05:30
---
# Static sites and GitLab Pages domains
2019-07-31 22:56:46 +05:30
On this docucument, learn how to name your project for GitLab Pages
according to your intended website's URL.
2017-08-17 22:00:37 +05:30
2017-09-10 17:25:29 +05:30
## Static sites
2017-08-17 22:00:37 +05:30
GitLab Pages only supports static websites, meaning,
your output files must be HTML, CSS, and JavaScript only.
To create your static site, you can either hardcode in HTML,
CSS, and JS, or use a [Static Site Generator (SSG)](https://www.staticgen.com/)
to simplify your code and build the static site for you,
which is highly recommendable and much faster than hardcoding.
2019-07-31 22:56:46 +05:30
See the [further reading](#further-reading) section below for
references on static site concepts.
2017-08-17 22:00:37 +05:30
2019-07-31 22:56:46 +05:30
## GitLab Pages domain names
2017-08-17 22:00:37 +05:30
>**Note:**
If you use your own GitLab instance to deploy your
site with GitLab Pages, check with your sysadmin what's your
Pages wildcard domain. This guide is valid for any GitLab instance,
you just need to replace Pages wildcard domain on GitLab.com
(`*.gitlab.io`) with your own.
2019-07-31 22:56:46 +05:30
If you set up a GitLab Pages project on GitLab,
it will automatically be accessible under a
subdomain of `namespace.example.io`.
The [`namespace`](../../group/index.md#namespaces)
is defined by your username on GitLab.com,
or the group name you created this project under.
For GitLab self-managed instances, replace `example.io`
with your instance's Pages domain. For GitLab.com,
Pages domains are `*.gitlab.io`.
| Type of GitLab Pages | The name of the project created in GitLab | Website URL |
| -------------------- | ------------ | ----------- |
| User pages | `username.example.io` | `http(s)://username.example.io` |
| Group pages | `groupname.example.io` | `http(s)://groupname.example.io` |
| Project pages owned by a user | `projectname` | `http(s)://username.example.io/projectname` |
| Project pages owned by a group | `projectname` | `http(s)://groupname.example.io/projectname`|
| Project pages owned by a subgroup | `subgroup/projectname` | `http(s)://groupname.example.io/subgroup/projectname`|
CAUTION: **Warning:**
There are some known [limitations](introduction.md#limitations)
regarding namespaces served under the general domain name and HTTPS.
Make sure to read that section.
2018-03-17 18:26:18 +05:30
2019-07-31 22:56:46 +05:30
To understand Pages domains clearly, read the examples below.
2017-08-17 22:00:37 +05:30
2019-07-31 22:56:46 +05:30
### Project website examples
2017-08-17 22:00:37 +05:30
- You created a project called `blog` under your username `john`,
2019-07-07 11:18:12 +05:30
therefore your project URL is `https://gitlab.com/john/blog/`.
Once you enable GitLab Pages for this project, and build your site,
it will be available under `https://john.gitlab.io/blog/`.
2017-08-17 22:00:37 +05:30
- You created a group for all your websites called `websites`,
2019-07-07 11:18:12 +05:30
and a project within this group is called `blog`. Your project
URL is `https://gitlab.com/websites/blog/`. Once you enable
GitLab Pages for this project, the site will live under
`https://websites.gitlab.io/blog/`.
2019-03-02 22:35:43 +05:30
- You created a group for your engineering department called `engineering`,
2019-07-07 11:18:12 +05:30
a subgroup for all your documentation websites called `docs`,
and a project within this subgroup is called `workflows`. Your project
URL is `https://gitlab.com/engineering/docs/workflows/`. Once you enable
GitLab Pages for this project, the site will live under
`https://engineering.gitlab.io/docs/workflows`.
2017-08-17 22:00:37 +05:30
2019-07-31 22:56:46 +05:30
### User and Group website examples
2017-08-17 22:00:37 +05:30
- Under your username, `john`, you created a project called
2019-07-07 11:18:12 +05:30
`john.gitlab.io`. Your project URL will be `https://gitlab.com/john/john.gitlab.io`.
Once you enable GitLab Pages for your project, your website
will be published under `https://john.gitlab.io`.
2017-08-17 22:00:37 +05:30
- Under your group `websites`, you created a project called
2019-07-07 11:18:12 +05:30
`websites.gitlab.io`. your project's URL will be `https://gitlab.com/websites/websites.gitlab.io`.
Once you enable GitLab Pages for your project,
your website will be published under `https://websites.gitlab.io`.
2017-08-17 22:00:37 +05:30
**General example:**
- On GitLab.com, a project site will always be available under
2019-07-07 11:18:12 +05:30
`https://namespace.gitlab.io/project-name`
2017-08-17 22:00:37 +05:30
- On GitLab.com, a user or group website will be available under
2019-07-07 11:18:12 +05:30
`https://namespace.gitlab.io/`
2017-08-17 22:00:37 +05:30
- On your GitLab instance, replace `gitlab.io` above with your
2019-07-07 11:18:12 +05:30
Pages server domain. Ask your sysadmin for this information.
2017-08-17 22:00:37 +05:30
2018-03-27 19:54:05 +05:30
_Read on about [Projects for GitLab Pages and URL structure](getting_started_part_two.md)._
2019-07-31 22:56:46 +05:30
### Further reading
- Read through this technical overview on [Static versus Dynamic Websites](https://about.gitlab.com/2016/06/03/ssg-overview-gitlab-pages-part-1-dynamic-x-static/)
- Understand [how modern Static Site Generators work](https://about.gitlab.com/2016/06/10/ssg-overview-gitlab-pages-part-2/) and what you can add to your static site
- You can use [any SSG with GitLab Pages](https://about.gitlab.com/2016/06/17/ssg-overview-gitlab-pages-part-3-examples-ci/)
2019-12-04 20:38:33 +05:30
- Fork an [example project](https://gitlab.com/pages) to build your website based upon