diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-18 15:09:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-18 15:09:16 +0300 |
commit | adcc3955fe5226e808548d64b545ba94378e5d52 (patch) | |
tree | 4405a81119b4fd34cfd5321dba30a5fa613cfb13 /doc/user/project/static_site_editor | |
parent | 28724c880bbd3e1b5c9ef0d01e8856024c77ca6a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/user/project/static_site_editor')
-rw-r--r-- | doc/user/project/static_site_editor/index.md | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/doc/user/project/static_site_editor/index.md b/doc/user/project/static_site_editor/index.md index e58667c275c..c2d4c77a469 100644 --- a/doc/user/project/static_site_editor/index.md +++ b/doc/user/project/static_site_editor/index.md @@ -66,10 +66,12 @@ easily [edit your content](#edit-content). 1. To get started, create a new project from the [Static Site Editor - Middleman](https://gitlab.com/gitlab-org/project-templates/static-site-editor-middleman) template. You can either [fork it](../repository/forking_workflow.md#creating-a-fork) or [create a new project from a template](../../../gitlab-basics/create-project.md#built-in-templates). -1. Edit the [`data/config.yml`](#configuration-files) configuration file +1. Edit the [`data/config.yml`](#static-site-generator-configuration) configuration file to replace `<username>` and `<project-name>` with the proper values for - your project's path. This triggers a CI/CD pipeline to deploy your project - with GitLab Pages. + your project's path. +1. (Optional) Edit the [`.gitlab/static-site-editor.yml`](#static-site-editor-configuration-file) file + to customize the behavior of the Static Site Editor. +1. When you submit your changes, GitLab triggers a CI/CD pipeline to deploy your project with GitLab Pages. 1. When the pipeline finishes, from your project's left-side menu, go to **Settings > Pages** to find the URL of your new website. 1. Visit your website and look at the bottom-left corner of the screen to see the new **Edit this page** button. @@ -179,6 +181,41 @@ yet. You can do so by editing the file locally, through the GitLab regular file ## Configuration files +You can customize the behavior of a project which uses the Static Site Editor with +the following configuration files: + +- The [`.gitlab/static-site-editor.yml`](#static-site-editor-configuration-file), which customizes the + behavior of the Static Site Editor. +- [Static Site Generator configuration files](#static-site-generator-configuration), + such as `data/config.yml`, which configures the Static Site Generator itself. + It also controls the **Edit this page** button when the site is generated. + +### Static Site Editor configuration file + +> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/4267) in GitLab 13.6. + +The `.gitlab/static-site-editor.yml` configuration file contains entries you can +use to customize behavior of the Static Site Editor (SSE). If the file does not exist, +default values which support a default Middleman project configuration are used. +The [Static Site Editor - Middleman](https://gitlab.com/gitlab-org/project-templates/static-site-editor-middleman) project template generates a file pre-populated with these defaults. + +To customize the behavior of the SSE, edit `.gitlab/static-site-editor.yml`'s entries +(described in the table below) according to what works best for your project (respecting YAML syntax). + +After the table, see an [example of the SSE configuration file](#gitlabstatic-site-editoryml-example). + +| Entry | GitLab version | Type | Default value | Description | +|---|---|---|---|---| +| `image_upload_path` | [13.6](https://gitlab.com/gitlab-org/gitlab/-/issues/216641) | String | `source/images` | Directory for images uploaded from the WYSIWYG editor. | + +#### `.gitlab/static-site-editor.yml` example + +```yaml +image_upload_path: 'source/images' # Relative path to the project's root. Don't include leading or trailing slashes. +``` + +### Static Site Generator configuration + The Static Site Editor uses Middleman's configuration file, `data/config.yml` to customize the behavior of the project itself and to control the **Edit this page** button, rendered through the file [`layout.erb`](https://gitlab.com/gitlab-org/project-templates/static-site-editor-middleman/-/blob/master/source/layouts/layout.erb). |