Skip to content

Fix edit link

Achilleas Pipinellis requested to merge axil-fix-edit-link into main

Fixes #1032 (closed)

Before !1742 (merged), we symlinked the repositories under content, so @item[:content_filename] existed. Since we merged the data sources MR, no docs content is under content/, so we need to use the identifier instead.

How to test:

bundle exec nanoc shell
[17] pry(#<Nanoc::Core::Context>)> @items.to_a[1000].identifier.to_s.split('/')
[17] pry(#<Nanoc::Core::Context>)> content_filename_array = @items.to_a[1000].identifier.to_s.split('/')
=> ["", "ee", "user", "project", "quick_actions.md"]
[18] pry(#<Nanoc::Core::Context>)> content_filename_array.shift
=> ""
[19] pry(#<Nanoc::Core::Context>)> product = content_filename_array.shift
=> "ee"
[20] pry(#<Nanoc::Core::Context>)> docs_content_filename = content_filename_array.join("/")
=> "user/project/quick_actions.md"
  • Before: /content/ee/user/project/quick_actions.md
  • After: /ee/user/project/quick_actions.md
Edited by Achilleas Pipinellis

Merge request reports