Commit 07a9173e authored by Suzanne Selhorn's avatar Suzanne Selhorn

Docs: Pages from forked sample

Part of an effort to clean up the Pages content
parent b37eb1a0
...@@ -5,68 +5,52 @@ group: Release Management ...@@ -5,68 +5,52 @@ group: Release Management
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
--- ---
# New Pages website from a forked sample # Create a Pages website from a forked sample
To get started with GitLab Pages from a sample website, the easiest GitLab provides [sample projects for the most popular Static Site Generators](https://gitlab.com/pages).
way to do it is by using one of the [bundled templates](pages_bundled_template.md). You can fork one of the sample projects and run the CI/CD pipeline to generate a Pages website.
If you don't find one that suits your needs, you can opt by
forking (copying) a [sample project from the most popular Static Site Generators](https://gitlab.com/pages). Fork a sample project when you want to test GitLab Pages or start a new project that's already
configured to generate a Pages site.
<table class="borderless-table center fixed-table middle width-80">
<tr> <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> Watch a [video tutorial](https://www.youtube.com/watch?v=TWqh9MtT4Bg) of how this works.
<td style="width: 30%"><img src="../img/icons/fork.png" alt="Fork" class="image-noshadow half-width"></td>
<td style="width: 10%"> To fork a sample project and create a Pages website:
<strong>
<i class="fa fa-angle-double-right" aria-hidden="true"></i> 1. View the sample projects by going to the [GitLab Pages examples](https://gitlab.com/pages) group.
</strong> 1. Click the name of the project you want to [fork](../../../../gitlab-basics/fork-project.md).
</td> 1. In the top right, click the **Fork** button, and then choose a namespace to fork to.
<td style="width: 30%"><img src="../img/icons/terminal.png" alt="Deploy" class="image-noshadow half-width"></td> 1. Go to your project's **CI/CD > Pipelines** and click **Run pipeline**.
<td style="width: 10%"> GitLab CI/CD builds and deploys your site.
<strong>
<i class="fa fa-angle-double-right" aria-hidden="true"></i> When the pipeline is finished, go to **Settings > Pages** to find the link to your website from your project.
</strong> It can take approximately 30 minutes to deploy.
</td>
<td style="width: 30%"><img src="../img/icons/click.png" alt="Visit" class="image-noshadow half-width"></td> For every change pushed to your repository, GitLab CI/CD runs a new pipeline
</tr> that immediately publishes your changes to the Pages site.
<tr>
<td><em>Fork an example project</em></td> You can take some **optional** further steps:
<td></td>
<td><em>Deploy your website</em></td> - _Remove the fork relationship._ If you want to contribute to the project you forked from,
<td></td> you can keep this relationship. Otherwise, go to your project's **Settings > General**,
<td><em>Visit your website's URL</em></td> expand **Advanced settings**, and scroll down to **Remove fork relationship**:
</tr>
</table> ![Remove fork relationship](../img/remove_fork_relationship_v13_1.png)
**<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.** - _Change the URL to match your namespace._ If your Pages site is hosted on GitLab.com,
you can rename it to `<namespace>.gitlab.io`, where `<namespace>` is your GitLab namespace
1. [Fork](../../../../gitlab-basics/fork-project.md) a sample project from the [GitLab Pages examples](https://gitlab.com/pages) group. (the one you chose when you forked the project).
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 - Go to your project's **Settings > General** and expand **Advanced**. Scroll down to
site to the server. **Change path** and change the path to `<namespace>.gitlab.io`.
1. Once the pipeline has finished successfully, find the link to visit your
website from your project's **Settings > Pages**. It can take approximately For example, if your project's URL is `gitlab.com/gitlab-tests/jekyll`, your namespace is
30 minutes to be deployed. `gitlab-tests`.
You can also take some **optional** further steps: If you set the repository path to `gitlab-tests.gitlab.io`,
the resulting URL for your Pages website is `https://gitlab-tests.gitlab.io`.
- _Remove the fork relationship._ The fork relationship 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)
- _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`: go to your project's
**Settings > General** and expand **Advanced**. Scroll down to
**Change path** and change the path to `namespace.gitlab.io`.
For example, consider the group `https://gitlab.com/gitlab-tests`:
`gitlab-tests` is the group's namespace, the repository path should be set
to `gitlab-tests.gitlab.io` (yes, weird like that), and the
resulting URL for your Pages website will be `https://gitlab-tests.gitlab.io`.
![Change repo's path](../img/change_path_v12_10.png) ![Change repo's path](../img/change_path_v12_10.png)
- Adjust your SSG's [base URL](../getting_started_part_one.md#urls-and-baseurls) from `"project-name"` to - Now go to your SSG's config file and change the [base URL](../getting_started_part_one.md#urls-and-baseurls)
`""`. This setting will be at a different place for each SSG, as each of them from `"project-name"` to `""`. The project name setting varies by SSG and may not be in the config file.
have their own structure and file tree. Most likely, it will be in the SSG's
config file.
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