Commit 88617924 authored by Marcia Ramos's avatar Marcia Ramos

Merge branch 'docs-pages-index-proj-templates' into 'master'

Docs: use Pages project templates as default getting started

Closes #58033

See merge request gitlab-org/gitlab-ce!25776
parents d655ed37 6671a619
--- ---
last_updated: 2018-02-16 last_updated: 2019-03-05
author: Marcia Ramos author: Marcia Ramos
author_gitlab: marcia author_gitlab: marcia
level: beginner level: beginner
...@@ -21,8 +21,8 @@ To get started with GitLab Pages, you need: ...@@ -21,8 +21,8 @@ To get started with GitLab Pages, you need:
Optional Features: Optional Features:
1. A custom domain or subdomain 1. A custom domain or subdomain.
1. A DNS pointing your (sub)domain to your Pages site 1. A DNS pointing your (sub)domain to your Pages site.
1. **Optional**: an SSL/TLS certificate so your custom 1. **Optional**: an SSL/TLS certificate so your custom
domain is accessible under HTTPS. domain is accessible under HTTPS.
...@@ -33,54 +33,73 @@ The optional settings, custom domain, DNS records, and SSL/TLS certificates, are ...@@ -33,54 +33,73 @@ The optional settings, custom domain, DNS records, and SSL/TLS certificates, are
Your GitLab Pages project is a regular project created the Your GitLab Pages project is a regular project created the
same way you do for the other ones. To get started with GitLab Pages, you have three ways: same way you do for the other ones. To get started with GitLab Pages, you have three ways:
- Use one of the popular templates already in the app, - [Use one of the popular project templates bundled with GitLab](#use-one-of-the-popular-pages-templates-bundled-with-gitlab).
- Fork one of the templates from Page Examples, or - [Fork one of the templates from Page Examples](#fork-a-project-to-get-started-from).
- Create a new project from scratch - [Create a new project from scratch](#create-a-project-from-scratch).
Let's go over each option.
### Use one of the popular Pages templates bundled with GitLab ### Use one of the popular Pages templates bundled with GitLab
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/47857) > [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/47857)
in GitLab 11.8. in GitLab 11.8.
The simplest way to create a GitLab Pages site is to use one of the most The simplest way to create a GitLab Pages site is to
popular templates, which come already bundled and ready to go. To use one [use one of the most popular templates](index.md#getting-started),
of these templates: which come already bundled with GitLab and are ready to go.
1. From the top navigation, click the **+** button and select **New project**
1. Select **Create from Template**
1. Choose one of the templates starting with **Pages**
### Fork a project to get started from ### Fork a project to get started from
To make things easy for you, we've created this If you don't find an existing project template that suits you,
[group](https://gitlab.com/pages) of default projects we've created this [group](https://gitlab.com/pages) of default projects
containing the most popular SSGs templates. containing the most popular SSGs templates to get you started.
Watch the [video tutorial](https://youtu.be/TWqh9MtT4Bg) we've <table class="borderless-table center fixed-table middle width-80">
created for the steps below. <tr>
<td style="width: 30%"><img src="img/icons/fork.png" alt="Fork" class="image-noshadow half-width"></td>
1. [Fork a sample project](../../../gitlab-basics/fork-project.md) from the [Pages group](https://gitlab.com/pages) <td style="width: 10%">
1. Trigger a build (push a change to any file) <strong>
1. As soon as the build passes, your website will have been deployed with GitLab Pages. Your website URL will be available under your project's **Settings** > **Pages** <i class="fa fa-angle-double-right" aria-hidden="true"></i>
1. Optionally, remove the fork relationship by navigating to your project's **Settings** > expanding **Advanced settings** and scrolling down to **Remove fork relationship**: </strong>
</td>
<td style="width: 30%"><img src="img/icons/terminal.png" alt="Deploy" class="image-noshadow half-width"></td>
<td style="width: 10%">
<strong>
<i class="fa fa-angle-double-right" aria-hidden="true"></i>
</strong>
</td>
<td style="width: 30%"><img src="img/icons/click.png" alt="Visit" class="image-noshadow half-width"></td>
</tr>
<tr>
<td><em>Fork an example project</em></td>
<td></td>
<td><em>Deploy your website</em></td>
<td></td>
<td><em>Visit your website's URL</em></td>
</tr>
</table>
**<i class="fa fa-youtube-play youtube" aria-hidden="true"></i> Watch a [video tutorial](https://www.youtube.com/watch?v=TWqh9MtT4Bg) with all the steps below.**
1. [Fork](../../../gitlab-basics/fork-project.md) a sample project from the [GitLab Pages examples](https://gitlab.com/pages) group.
1. From the left sidebar, navigate to your project's **CI/CD > Pipelines**
and click **Run pipeline** to trigger GitLab CI/CD to build and deploy your
site to the server.
1. Once the pipeline has finished successfully, find the link to visit your
website from your project's **Settings > Pages**.
You can also take some **optional** further steps:
- _Remove the fork relationship._ The fork relashionship is necessary to contribute back to the project you originally forked from. If you don't have any intentions to do so, you can remove it. To do so, navigate to your project's **Settings**, expand **Advanced settings**, and scroll down to **Remove fork relationship**:
![remove fork relationship](img/remove_fork_relationship.png) ![remove fork relationship](img/remove_fork_relationship.png)
To turn a **project website** forked from the Pages group into a **user/group** website, you'll need to: - _Make it a user or group website._ To turn a **project website** forked
from the Pages group into a **user/group** website, you'll need to:
- Rename it to `namespace.gitlab.io`: navigate to project's **Settings** > expand **Advanced settings** > and scroll down to **Rename repository** - Rename it to `namespace.gitlab.io`: navigate to project's **Settings** >
- Adjust your SSG's [base URL](#urls-and-baseurls) from `"project-name"` to `""`. This setting will be at a different place for each SSG, as each of them have their own structure and file tree. Most likely, it will be in the SSG's config file. expand **Advanced settings** > and scroll down to **Rename repository**.
- Adjust your SSG's [base URL](#urls-and-baseurls) from `"project-name"` to
> **Notes:** `""`. This setting will be at a different place for each SSG, as each of them
> have their own structure and file tree. Most likely, it will be in the SSG's
> Why do I need to remove the fork relationship? config file.
>
> Unless you want to contribute to the original project,
you won't need it connected to the upstream. A
[fork](https://about.gitlab.com/2016/12/01/how-to-keep-your-fork-up-to-date-with-its-origin/#fork)
is useful for submitting merge requests to the upstream.
### Create a project from scratch ### Create a project from scratch
......
--- ---
description: 'Learn how to use GitLab Pages to deploy a static website at no additional cost.' description: 'Learn how to use GitLab Pages to deploy a static website at no additional cost.'
last_updated: 2019-03-05
--- ---
# GitLab Pages # GitLab Pages
...@@ -8,8 +9,8 @@ description: 'Learn how to use GitLab Pages to deploy a static website at no add ...@@ -8,8 +9,8 @@ description: 'Learn how to use GitLab Pages to deploy a static website at no add
directly from a repository in GitLab.** directly from a repository in GitLab.**
You can use it either for personal or business websites, such as You can use it either for personal or business websites, such as
portfolios, documentation, manifestos, and business presentations, portfolios, documentation, manifestos, and business presentations.
and attribute any license to your content. You can also attribute any license to your content.
<table class="borderless-table center fixed-table"> <table class="borderless-table center fixed-table">
<tr> <tr>
...@@ -91,52 +92,28 @@ site under the HTTPS protocol. ...@@ -91,52 +92,28 @@ site under the HTTPS protocol.
## Getting started ## Getting started
To get started with GitLab Pages, you can either [create a project from scratch](getting_started_part_two.md#create-a-project-from-scratch), To get started with GitLab Pages, you can either:
use a [bundled template](getting_started_part_two.md#use-one-of-the-popular-pages-templates-bundled-with-gitlab), or copy any of our existing example projects:
1. Choose an [example project](https://gitlab.com/pages) to [fork](../../../gitlab-basics/fork-project.md#how-to-fork-a-project): - [Create a project from scratch](getting_started_part_two.md#create-a-project-from-scratch).
by forking a project, you create a copy of the codebase you're forking from to start from a template instead of starting from scratch. - [Copy an existing example project](getting_started_part_two.md#fork-a-project-to-get-started-from).
1. From the left sidebar, navigate to your project's **CI/CD > Pipelines** and click - Use a bundled project template that is ready to go ([introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/47857)
**Run pipeline** so that GitLab CI/CD will build and deploy your site to the server. in GitLab 11.8), as follows:
1. Once the pipeline has finished successfully, find the link to visit your website from your
project's **Settings > Pages**.
<table class="borderless-table center fixed-table middle width-80"> 1. From the top navigation, click the **+** button and select **New project**.
<tr> 1. Select **Create from Template**.
<td style="width: 30%"><img src="img/icons/fork.png" alt="Fork" class="image-noshadow half-width"></td> 1. Choose one of the templates starting with **Pages**:
<td style="width: 10%">
<strong>
<i class="fa fa-angle-double-right" aria-hidden="true"></i>
</strong>
</td>
<td style="width: 30%"><img src="img/icons/terminal.png" alt="Deploy" class="image-noshadow half-width"></td>
<td style="width: 10%">
<strong>
<i class="fa fa-angle-double-right" aria-hidden="true"></i>
</strong>
</td>
<td style="width: 30%"><img src="img/icons/click.png" alt="Visit" class="image-noshadow half-width"></td>
</tr>
<tr>
<td><em>Fork an example project</em></td>
<td></td>
<td><em>Deploy your website</em></td>
<td></td>
<td><em>Visit your website's URL</em></td>
</tr>
</table>
Your website is then visible on your domain, and you can modify your files
as you wish. For every modification pushed to your repository, GitLab CI/CD will run
a new pipeline to publish your changes to the server.
You can also take some optional further steps: ![Project templates for Pages](img/pages_project_templates_11-8.png)
- Remove the [fork relationship](getting_started_part_two.md#fork-a-project-to-get-started-from) 1. From the left sidebar, navigate to your project's **CI/CD > Pipelines**
(_You don't need the relationship unless you intent to contribute back to the example project you forked from_). and click **Run pipeline** to trigger GitLab CI/CD to build and deploy your
- Make it a [user/group website](getting_started_part_one.md#user-and-group-websites) site to the server.
1. Once the pipeline has finished successfully, find the link to visit your
website from your project's **Settings > Pages**.
**<i class="fa fa-youtube-play youtube" aria-hidden="true"></i> Watch a [video tutorial](https://www.youtube.com/watch?v=TWqh9MtT4Bg) with all the steps above!** Your website is then visible on your domain, and you can modify yourfiles
as you wish. For every modification pushed to your repository, GitLab CI/CD
will run a new pipeline to publish your changes to the server.
_Advanced options:_ _Advanced options:_
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment