diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2018-03-23 19:24:43 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2018-03-23 20:35:59 +0300 |
commit | 1e4d6798da270f70290e4a0e1f650a8adbfa87da (patch) | |
tree | bd8a82465805abf6576d99ba4c86de3e88e8990f /lib | |
parent | a2d404c6a87178830ef41e5908f4f8e8a53ce8a1 (diff) |
Make edit links work with the docs site as well
Diffstat (limited to 'lib')
-rw-r--r-- | lib/helpers/edit_on_gitlab.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/helpers/edit_on_gitlab.rb b/lib/helpers/edit_on_gitlab.rb index d6adf2e5..fbb1609c 100644 --- a/lib/helpers/edit_on_gitlab.rb +++ b/lib/helpers/edit_on_gitlab.rb @@ -8,17 +8,20 @@ module Nanoc::Helpers # Get the product name. product = content_filename_array.shift # This should be the path from the doc/ directory for a given file. - content_filename = content_filename_array.join("/") + docs_content_filename = content_filename_array.join("/") if product == "omnibus" # omnibus-gitlab repo - gitlab_url = "https://gitlab.com/gitlab-org/#{product}-gitlab/edit/master/doc/#{content_filename}" + gitlab_url = "https://gitlab.com/gitlab-org/#{product}-gitlab/edit/master/doc/#{docs_content_filename}" elsif product == "runner" # gitlab-runner repo - gitlab_url = "https://gitlab.com/gitlab-org/gitlab-#{product}/edit/master/docs/#{content_filename}" - else + gitlab_url = "https://gitlab.com/gitlab-org/gitlab-#{product}/edit/master/docs/#{docs_content_filename}" + elsif (product == "ce" or product == "ee") # gitlab-ce and gitlab-ee repos - gitlab_url = "https://gitlab.com/gitlab-org/gitlab-#{product}/edit/master/doc/#{content_filename}" + gitlab_url = "https://gitlab.com/gitlab-org/gitlab-#{product}/edit/master/doc/#{docs_content_filename}" + else + # gitlab-docs pages + gitlab_url = "https://gitlab.com/gitlab-com/gitlab-docs/edit/master/#{@item[:content_filename]}" end result = "<a href='#{gitlab_url}'>Edit this page</a>" |