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 | |
parent | a2d404c6a87178830ef41e5908f4f8e8a53ce8a1 (diff) |
Make edit links work with the docs site as well
-rw-r--r-- | layouts/footer_homepage.html | 6 | ||||
-rw-r--r-- | layouts/home.html | 2 | ||||
-rw-r--r-- | layouts/instantsearch.html | 2 | ||||
-rw-r--r-- | lib/helpers/edit_on_gitlab.rb | 13 |
4 files changed, 10 insertions, 13 deletions
diff --git a/layouts/footer_homepage.html b/layouts/footer_homepage.html deleted file mode 100644 index fb90dfa6..00000000 --- a/layouts/footer_homepage.html +++ /dev/null @@ -1,6 +0,0 @@ -<footer class=footer> - <%= render '/footer_links.*' %> - <div class='animated text-center source-link'> - <a href='https://gitlab.com/gitlab-com/gitlab-docs' target='_blank'>Created</a> with Nanoc, hosted on <a href='https://about.gitlab.com/features/pages/' target='_blank'>GitLab Pages</a> - </div> -</footer> diff --git a/layouts/home.html b/layouts/home.html index 6d1f1472..9f54923e 100644 --- a/layouts/home.html +++ b/layouts/home.html @@ -12,7 +12,7 @@ </div> <%= yield %> - <%= render '/footer_homepage.*' %> + <%= render '/footer.*' %> <%= render '/docsearch.*' %> <%= render '/analytics.*' %> <%= render '/https_redirect.*' %> diff --git a/layouts/instantsearch.html b/layouts/instantsearch.html index 58c7a304..7d9def6c 100644 --- a/layouts/instantsearch.html +++ b/layouts/instantsearch.html @@ -21,7 +21,7 @@ <hr> <div class="clear"></div> </div> - <%= render '/footer_homepage.*' %> + <%= render '/footer.*' %> <%= render '/analytics.*' %> <%= render '/https_redirect.*' %> <script type="text/javascript"> 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>" |