Commit 0cc93d2b authored by Chris Snijder's avatar Chris Snijder 🏅
Browse files

Return URL's instead of compiled links for flexibility.

parent 7fd4b953
......@@ -23,14 +23,13 @@ class RecursiveNav < ::Middleman::Extension
# Check if same file exists in other language
if File.exists? current_page.source_file.sub("/#{locale}/", "/#{loc}/")
# Make a link to other language
links[loc] = link_to('this page',
'/' + current_page.path.sub("/#{locale}/", "/#{loc}/"))
links[loc] = "/#{current_page.path.sub('/#{locale}/', '/#{loc}/')}"
end
else
path = current_page.target.sub("pages/", "").sub(/([\.\/])#{locale}([\.\/])/, "\\1#{loc}\\2")
link = extensions[:i18n].localized_path("/#{path}", loc)
if link
links[loc] = link_to('this page', link)
links[loc] = link
end
end
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment