Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Norris <cnorris@gitlab.com>2021-06-07 21:37:10 +0300
committerCraig Norris <cnorris@gitlab.com>2021-06-07 21:37:10 +0300
commit3310df198024909b9a7d9fc79969458b0d251615 (patch)
tree95992dd303649d7d08074bea2cc21289e6461433
parent8d9e30f14623c907f29f73883fefcae034092b39 (diff)
parent411d4ec02f200683ac924df0b8f8a90d817b7048 (diff)
Merge branch 'axil-fix-edit-link' into 'main'
Fix edit link Closes #1032 See merge request gitlab-org/gitlab-docs!1860
-rw-r--r--lib/helpers/edit_on_gitlab.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/helpers/edit_on_gitlab.rb b/lib/helpers/edit_on_gitlab.rb
index 883954c3..2946c1f9 100644
--- a/lib/helpers/edit_on_gitlab.rb
+++ b/lib/helpers/edit_on_gitlab.rb
@@ -2,8 +2,8 @@ module Nanoc::Helpers
module EditOnGitLab
def edit_on_gitlab(item, editor: :simple)
# Make an array out of the content's source path.
- content_filename_array = @item[:content_filename].split('/')
- # Remove "/content/"
+ content_filename_array = @item.identifier.to_s.split('/')
+ # remove first empty item
content_filename_array.shift
# Get the product name.
product = content_filename_array.shift
@@ -23,7 +23,7 @@ module Nanoc::Helpers
gitlab_url = "https://gitlab.com/gitlab-org/#{product}/gitlab/blob/master/doc/#{docs_content_filename}"
gitlab_ide_url = "https://gitlab.com/-/ide/project/gitlab-org/#{product}/gitlab/edit/master/-/doc/#{docs_content_filename}"
# gitlab-foss and gitlab repos
- elsif %w[ce ee].include?(product)
+ elsif product = "ee"
gitlab_url = "https://gitlab.com/gitlab-org/gitlab/blob/master/doc/#{docs_content_filename}"
gitlab_ide_url = "https://gitlab.com/-/ide/project/gitlab-org/gitlab/edit/master/-/doc/#{docs_content_filename}"
else