summaryrefslogtreecommitdiff
path: root/doc/development/documentation/index.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/development/documentation/index.md')
-rw-r--r--doc/development/documentation/index.md18
1 files changed, 17 insertions, 1 deletions
diff --git a/doc/development/documentation/index.md b/doc/development/documentation/index.md
index 5fb5e9b433a..55f5d43b175 100644
--- a/doc/development/documentation/index.md
+++ b/doc/development/documentation/index.md
@@ -173,7 +173,7 @@ There are two types of redirects:
- Redirect files added into the docs themselves, for users who view the docs in `/help`
on self-managed instances. For example, [`/help` on GitLab.com](https://gitlab.com/help).
- Redirects in a [`_redirects`](../../user/project/pages/redirects.md) file, for users
- who view the docs on <http://docs.gitlab.com>.
+ who view the docs on <https://docs.gitlab.com>.
To add a redirect:
@@ -201,6 +201,9 @@ To add a redirect:
1. If the document being moved has any Disqus comments on it, follow the steps
described in [Redirections for pages with Disqus comments](#redirections-for-pages-with-disqus-comments).
+ 1. If a documentation page you're removing includes images that aren't used
+ with any other documentation pages, be sure to use your MR to delete
+ those images from the repository.
1. Assign the MR to a technical writer for review and merge.
1. If the redirect is to one of the 4 internal docs projects (not an external URL),
create an MR in [`gitlab-docs`](https://gitlab.com/gitlab-org/gitlab-docs):
@@ -366,6 +369,19 @@ You can combine one or more of the following:
= link_to 'Help page', help_page_path('user/permissions')
```
+#### Linking to `/help` in JavaScript
+
+To link to the documentation from a JavaScript or a Vue component, use the `helpPagePath` function from [`help_page_helper.js`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/helpers/help_page_helper.js):
+
+```javascript
+import { helpPagePath } from '~/helpers/help_page_helper';
+
+helpPagePath('user/permissions', { anchor: 'anchor-link' })
+// evaluates to '/help/user/permissions#anchor-link' for GitLab.com
+```
+
+This is preferred over static paths, as the helper also works on instances installed under a [relative URL](../../install/relative_url.md).
+
### GitLab `/help` tests
Several [RSpec tests](https://gitlab.com/gitlab-org/gitlab/blob/master/spec/features/help_pages_spec.rb)