diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-25 03:07:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-25 03:07:25 +0300 |
commit | f1bbdb01e8adbec14e272d0472281d2acf58712f (patch) | |
tree | 27f8b94d9ae123f46f6a5b1a5c3c110434d6f20d /doc | |
parent | 4e341944acb64c4aaa8ecd467958d28c5bcfcc3a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc')
-rw-r--r-- | doc/development/documentation/index.md | 6 | ||||
-rw-r--r-- | doc/development/fe_guide/haml.md | 4 | ||||
-rw-r--r-- | doc/user/project/repository/mirror/push.md | 11 |
3 files changed, 14 insertions, 7 deletions
diff --git a/doc/development/documentation/index.md b/doc/development/documentation/index.md index 6811b3d6584..2ab94207269 100644 --- a/doc/development/documentation/index.md +++ b/doc/development/documentation/index.md @@ -260,7 +260,7 @@ is inside `_()` so it can be translated: ```haml - link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/permissions') } - %p= _("This is a text describing the option/feature in a sentence. %{link_start}Learn more.%{link_end}").html_safe % { link_start: link_start, link_end: '</a>'.html_safe } + %p= safe_format(_("This is a text describing the option/feature in a sentence. %{link_start}Learn more.%{link_end}"), link_start: link_start, link_end: '</a>'.html_safe) ``` - Using a button link. Useful in places where text would be out of context with @@ -290,7 +290,7 @@ be translated: ```ruby docs_link = link_to _('Learn more.'), help_page_url('user/permissions', anchor: 'anchor-link'), target: '_blank', rel: 'noopener noreferrer' -_('This is a text describing the option/feature in a sentence. %{docs_link}').html_safe % { docs_link: docs_link.html_safe } +safe_format(_('This is a text describing the option/feature in a sentence. %{docs_link}'), docs_link: docs_link) ``` In cases where you need to generate a link from outside of views/helpers, where the `link_to` and `help_page_url` methods are not available, use the following code block @@ -298,7 +298,7 @@ as a guide where the methods are fully qualified: ```ruby docs_link = ActionController::Base.helpers.link_to _('Learn more.'), Rails.application.routes.url_helpers.help_page_url('user/permissions', anchor: 'anchor-link'), target: '_blank', rel: 'noopener noreferrer' -_('This is a text describing the option/feature in a sentence. %{docs_link}').html_safe % { docs_link: docs_link.html_safe } +safe_format(_('This is a text describing the option/feature in a sentence. %{docs_link}'), docs_link: docs_link) ``` Do not use `include ActionView::Helpers::UrlHelper` just to make the `link_to` method available as you might see in some existing code. Read more in diff --git a/doc/development/fe_guide/haml.md b/doc/development/fe_guide/haml.md index 9281f01d750..1dc8cf63de9 100644 --- a/doc/development/fe_guide/haml.md +++ b/doc/development/fe_guide/haml.md @@ -42,7 +42,7 @@ For example: = f.check_box :prevent_sharing_groups_outside_hierarchy, disabled: !can_change_prevent_sharing_groups_outside_hierarchy?(@group), class: 'custom-control-input' = f.label :prevent_sharing_groups_outside_hierarchy, class: 'custom-control-label' do %span - = s_('GroupSettings|Prevent members from sending invitations to groups outside of %{group} and its subgroups.').html_safe % { group: link_to_group(@group) } + = safe_format(s_('GroupSettings|Prevent members from sending invitations to groups outside of %{group} and its subgroups.'), group: link_to_group(@group)) %p.help-text= prevent_sharing_groups_outside_hierarchy_help_text(@group) .form-group.gl-mb-3 @@ -61,7 +61,7 @@ For example: = gitlab_ui_form_for @group do |f| .form-group.gl-mb-3 = f.gitlab_ui_checkbox_component :prevent_sharing_groups_outside_hierarchy, - s_('GroupSettings|Prevent members from sending invitations to groups outside of %{group} and its subgroups.').html_safe % { group: link_to_group(@group) }, + safe_format(s_('GroupSettings|Prevent members from sending invitations to groups outside of %{group} and its subgroups.'), group: link_to_group(@group)), help_text: prevent_sharing_groups_outside_hierarchy_help_text(@group), checkbox_options: { disabled: !can_change_prevent_sharing_groups_outside_hierarchy?(@group) } diff --git a/doc/user/project/repository/mirror/push.md b/doc/user/project/repository/mirror/push.md index 11093958650..dfd9911effc 100644 --- a/doc/user/project/repository/mirror/push.md +++ b/doc/user/project/repository/mirror/push.md @@ -79,8 +79,15 @@ To configure a mirror from GitLab to GitHub: 1. Create a [GitHub personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) with `public_repo` selected. -1. Enter a **Git repository URL** with this format: - `https://<your_access_token>@github.com/<github_group>/<github_project>.git`. +1. Enter a **Git repository URL** with this format, changing the variables as needed: + + ```plaintext + https://USERNAME@github.com/GROUP/PROJECT.git + ``` + + - `USERNAME`: The username of the owner of the personal access token. + - `GROUP`: The group on GitHub. + - `PROJECT`: The project on GitHub. 1. For **Password**, enter your GitHub personal access token. 1. Select **Mirror repository**. |