diff options
author | Connor Shea <connor.james.shea@gmail.com> | 2016-10-22 02:46:52 +0300 |
---|---|---|
committer | Connor Shea <connor.james.shea@gmail.com> | 2016-10-22 02:46:52 +0300 |
commit | 39ba7c8e7996632e593a5d04e0a0092493c96831 (patch) | |
tree | 217aed089d51499703d0d635f20c7afe69360356 /lib | |
parent | 64e962905b47b177be8f21761d6145aa871571dc (diff) |
Reword the Edit on GitLab link.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/filters/edit_on_gitlab_link.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/filters/edit_on_gitlab_link.rb b/lib/filters/edit_on_gitlab_link.rb index 09e87587..bcd6bba6 100644 --- a/lib/filters/edit_on_gitlab_link.rb +++ b/lib/filters/edit_on_gitlab_link.rb @@ -14,11 +14,14 @@ module Nanoc::Filters # This should be the path from the doc/ directory for a given file. content_filename = content_filename_array.join("/") - # Replace `EDIT_ON_GITLAB_LINK` with the actual URL. + # Replace `EDIT_ON_GITLAB_LINK` with the actual URL pointing to + # the source file. content.gsub(/href="(EDIT_ON_GITLAB_LINK)"/) do |result| if product == "omnibus" + # omnibus-gitlab repo result.gsub!(/EDIT_ON_GITLAB_LINK/, "https://gitlab.com/gitlab-org/#{product}-gitlab/blob/master/doc/#{content_filename}") else + # gitlab-ce and gitlab-ee repos result.gsub!(/EDIT_ON_GITLAB_LINK/, "https://gitlab.com/gitlab-org/gitlab-#{product}/blob/master/doc/#{content_filename}") end result |