@@ -7,14 +7,8 @@ info: To determine the technical writer assigned to the Stage/Group associated w
...
@@ -7,14 +7,8 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# GitLab Pages **(FREE)**
# GitLab Pages **(FREE)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/80) in GitLab Enterprise Edition 8.3.
With GitLab Pages, you can publish static websites directly from a repository
> - Custom CNAMEs with TLS support were [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/173) in GitLab Enterprise Edition 8.5.
in GitLab.
> - [Ported](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/14605) to GitLab Community Edition in GitLab 8.17.
> - Support for subgroup project's websites was [introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/30548) in GitLab 11.8.
> - Bundled project templates were [introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/47857) in GitLab 11.8.
With GitLab Pages, you can publish static websites
directly from a repository in GitLab.
<divclass="row">
<divclass="row">
<divclass="col-md-9">
<divclass="col-md-9">
...
@@ -32,11 +26,11 @@ directly from a repository in GitLab.
...
@@ -32,11 +26,11 @@ directly from a repository in GitLab.
<divclass="col-md-3"><imgsrc="img/ssgs_pages.png"alt="Examples of SSGs supported by Pages"class="middle display-block"></div>
<divclass="col-md-3"><imgsrc="img/ssgs_pages.png"alt="Examples of SSGs supported by Pages"class="middle display-block"></div>
</div>
</div>
To publish a website with Pages, you can use any SSG,
To publish a website with Pages, you can use any static site generator,
like Gatsby, Jekyll, Hugo, Middleman, Harp, Hexo, and Brunch, just to name a few. You can also
like Gatsby, Jekyll, Hugo, Middleman, Harp, Hexo, or Brunch. You can also
publish any website written directly in plain HTML, CSS, and JavaScript.
publish any website written directly in plain HTML, CSS, and JavaScript.
Pages does **not** support dynamic server-side processing, for instance, as `.php` and `.asp` requires.
Pages does not support dynamic server-side processing, for instance, as `.php` and `.asp` requires.
Learn more about
Learn more about
[static websites compared to dynamic websites](https://about.gitlab.com/blog/2016/06/03/ssg-overview-gitlab-pages-part-1-dynamic-x-static/).
[static websites compared to dynamic websites](https://about.gitlab.com/blog/2016/06/03/ssg-overview-gitlab-pages-part-1-dynamic-x-static/).
...
@@ -45,18 +39,18 @@ Learn more about
...
@@ -45,18 +39,18 @@ Learn more about
To create a GitLab Pages website:
To create a GitLab Pages website:
| Document | Description |
| Document | Description |
| -------- | ----------- |
|----------|-------------|
| [Create a `.gitlab-ci.yml` file from scratch](getting_started/pages_from_scratch.md)| Add a Pages site to an existing project. Learn how to create and configure your own CI file. |
| [Create a `.gitlab-ci.yml` file from scratch](getting_started/pages_from_scratch.md) | Add a Pages site to an existing project. Learn how to create and configure your own CI file. |
| [Use a `.gitlab-ci.yml` template](getting_started/pages_ci_cd_template.md) | Add a Pages site to an existing project. Use a pre-populated CI template file. |
| [Use a `.gitlab-ci.yml` template](getting_started/pages_ci_cd_template.md) | Add a Pages site to an existing project. Use a pre-populated CI template file. |
| [Fork a sample project](getting_started/pages_forked_sample_project.md)| Create a new project with Pages already configured by forking a sample project. |
| [Fork a sample project](getting_started/pages_forked_sample_project.md) | Create a new project with Pages already configured by forking a sample project. |
| [Use a project template](getting_started/pages_new_project_template.md)| Create a new project with Pages already configured by using a template. |
| [Use a project template](getting_started/pages_new_project_template.md) | Create a new project with Pages already configured by using a template. |
To update a GitLab Pages website:
To update a GitLab Pages website:
| Document | Description |
| Document | Description |
| -------- | ----------- |
|----------|-------------|
| [GitLab Pages domain names, URLs, and base URLs](getting_started_part_one.md) | Learn about GitLab Pages default domains. |
| [GitLab Pages domain names, URLs, and base URLs](getting_started_part_one.md) | Learn about GitLab Pages default domains. |
| [Custom domains and SSL/TLS Certificates](custom_domains_ssl_tls_certification/index.md) | Custom domains and subdomains, DNS records, and SSL/TLS certificates. |
| [Custom domains and SSL/TLS Certificates](custom_domains_ssl_tls_certification/index.md) | Custom domains and subdomains, DNS records, and SSL/TLS certificates. |
| [Let's Encrypt integration](custom_domains_ssl_tls_certification/lets_encrypt_integration.md) | Secure your Pages sites with Let's Encrypt certificates, which are automatically obtained and renewed by GitLab. |
| [Let's Encrypt integration](custom_domains_ssl_tls_certification/lets_encrypt_integration.md) | Secure your Pages sites with Let's Encrypt certificates, which are automatically obtained and renewed by GitLab. |
| [Redirects](redirects.md) | Set up HTTP redirects to forward one page to another. |
| [Redirects](redirects.md) | Set up HTTP redirects to forward one page to another. |
...
@@ -64,7 +58,7 @@ To update a GitLab Pages website:
...
@@ -64,7 +58,7 @@ To update a GitLab Pages website:
Learn more and see examples:
Learn more and see examples:
| Document | Description |
| Document | Description |
| -------- | ----------- |
|----------|-------------|
| [Static vs dynamic websites](https://about.gitlab.com/blog/2016/06/03/ssg-overview-gitlab-pages-part-1-dynamic-x-static/) | Static versus dynamic site overview. |
| [Static vs dynamic websites](https://about.gitlab.com/blog/2016/06/03/ssg-overview-gitlab-pages-part-1-dynamic-x-static/) | Static versus dynamic site overview. |
| [Modern static site generators](https://about.gitlab.com/blog/2016/06/10/ssg-overview-gitlab-pages-part-2/) | SSG overview. |
| [Modern static site generators](https://about.gitlab.com/blog/2016/06/10/ssg-overview-gitlab-pages-part-2/) | SSG overview. |
| [Build any SSG site with GitLab Pages](https://about.gitlab.com/blog/2016/06/17/ssg-overview-gitlab-pages-part-3-examples-ci/) | Use SSGs for GitLab Pages. |
| [Build any SSG site with GitLab Pages](https://about.gitlab.com/blog/2016/06/17/ssg-overview-gitlab-pages-part-3-examples-ci/) | Use SSGs for GitLab Pages. |
...
@@ -74,7 +68,7 @@ Learn more and see examples:
...
@@ -74,7 +68,7 @@ Learn more and see examples:
To use GitLab Pages, you must create a project in GitLab to upload your website's
To use GitLab Pages, you must create a project in GitLab to upload your website's
files to. These projects can be either public, internal, or private.
files to. These projects can be either public, internal, or private.
GitLab always deploys your website from a very specific folder called `public` in your
GitLab always deploys your website from a specific folder called `public` in your
repository. When you create a new project in GitLab, a [repository](../repository/index.md)
repository. When you create a new project in GitLab, a [repository](../repository/index.md)
becomes available automatically.
becomes available automatically.
...
@@ -95,24 +89,21 @@ The following diagrams show the workflows you might follow to get started with P
...
@@ -95,24 +89,21 @@ The following diagrams show the workflows you might follow to get started with P
## Access to your Pages site
## Access to your Pages site
If you're using GitLab Pages default domain (`.gitlab.io`),
If you're using GitLab Pages default domain (`.gitlab.io`), your website is
your website is automatically secure and available under
automatically secure and available under HTTPS. If you're using your own custom
HTTPS. If you're using your own custom domain, you can
domain, you can optionally secure it with SSL/TLS certificates.
optionally secure it with SSL/TLS certificates.
If you're using GitLab.com, your website is publicly available to the internet.
If you're using GitLab.com, your website is publicly available to the internet.
To restrict access to your website, enable [GitLab Pages Access Control](pages_access_control.md).
To restrict access to your website, enable [GitLab Pages Access Control](pages_access_control.md).
If you're using a self-managed instance (Free, Premium, or Ultimate),
If you're using a self-managed instance, your websites are published on your
your websites are published on your own server, according to the
own server, according to the [Pages settings](../../../administration/pages/index.md)
[Pages settings](../../../administration/pages/index.md) chosen by your sysadmin,
chosen by your sysadmin, who can make them public or internal.
who can make them public or internal.
## Pages examples
## Pages examples
There are some great examples of GitLab Pages websites built for
These GitLab Pages website examples can teach you advanced techniques to use
specific reasons. These examples can teach you advanced techniques
and adapt for your own needs:
to use and adapt to your own needs:
-[Posting to your GitLab Pages blog from iOS](https://about.gitlab.com/blog/2016/08/19/posting-to-your-gitlab-pages-blog-from-ios/).
-[Posting to your GitLab Pages blog from iOS](https://about.gitlab.com/blog/2016/08/19/posting-to-your-gitlab-pages-blog-from-ios/).
-[GitLab CI: Run jobs sequentially, in parallel, or build a custom pipeline](https://about.gitlab.com/blog/2016/07/29/the-basics-of-gitlab-ci/).
-[GitLab CI: Run jobs sequentially, in parallel, or build a custom pipeline](https://about.gitlab.com/blog/2016/07/29/the-basics-of-gitlab-ci/).
...
@@ -122,27 +113,27 @@ to use and adapt to your own needs:
...
@@ -122,27 +113,27 @@ to use and adapt to your own needs:
## Administer GitLab Pages for self-managed instances
## Administer GitLab Pages for self-managed instances
If you are running a self-managed instance of GitLab (GitLab Community Edition and Enterprise Editions),
If you are running a self-managed instance of GitLab,
[follow the administration steps](../../../administration/pages/index.md) to configure Pages.
[follow the administration steps](../../../administration/pages/index.md) to configure Pages.
<iclass="fa fa-youtube-play youtube"aria-hidden="true"></i> Watch a [video tutorial](https://www.youtube.com/watch?v=dD8c7WNcc6s) about how to get started with GitLab Pages administration.
<iclass="fa fa-youtube-play youtube"aria-hidden="true"></i> Watch a [video tutorial](https://www.youtube.com/watch?v=dD8c7WNcc6s) about how to get started with GitLab Pages administration.
## Security for GitLab Pages
## Security for GitLab Pages
If your username is `foo`, your GitLab Pages website is located at `foo.gitlab.io`.
If your username is `example`, your GitLab Pages website is located at `example.gitlab.io`.
GitLab allows usernames to contain a `.`, so a user named `bar.foo` could create
GitLab allows usernames to contain a `.`, so a user named `bar.example` could create
a GitLab Pages website `bar.foo.gitlab.io` that effectively is a subdomain of your
a GitLab Pages website `bar.example.gitlab.io` that effectively is a subdomain of your
`foo.gitlab.io` website. Be careful if you use JavaScript to set cookies for your website.
`example.gitlab.io` website. Be careful if you use JavaScript to set cookies for your website.
The safe way to manually set cookies with JavaScript is to not specify the `domain` at all:
The safe way to manually set cookies with JavaScript is to not specify the `domain` at all:
```javascript
```javascript
// Safe: This cookie is only visible to foo.gitlab.io
// Safe: This cookie is only visible to example.gitlab.io
document.cookie="key=value";
document.cookie="key=value";
// Unsafe: This cookie is visible to foo.gitlab.io and its subdomains,
// Unsafe: This cookie is visible to example.gitlab.io and its subdomains,