Commit 425e25d3 authored by Chris Snijder's avatar Chris Snijder 🏅
Browse files

Latest version of translation_links from website project config.

parent 40ed65f9
......@@ -22,14 +22,13 @@ class RecursiveNav < ::Middleman::Extension
if current_page.path.start_with? "blog"
# 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] = "/#{current_page.path.sub('/#{locale}/', '/#{loc}/')}"
links[loc] = url_for('/' + 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
url = extensions[:i18n].localized_path("/#{path}", loc)
if url
links[loc] = url_for(url)
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