Skip to content

Commit

Permalink
Let the Guides link in the navbar to point directly to the latest sta…
Browse files Browse the repository at this point in the history
…ble version of the guides
  • Loading branch information
jodosha committed Oct 30, 2017
1 parent 703e437 commit 70683ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def guides

def latest_stable_version_guides_path
latest_stable_version = Dir.glob("#{GUIDES_ROOT}/*").each_with_object([]) do |version, result|
next unless ::File.directory?(version)
next unless ::File.directory?(version) && version =~ /[\d]+\.[\d]+\z/
result << ::File.basename(version)
end.compact.sort.last

Expand Down
2 changes: 1 addition & 1 deletion source/_navbar.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<ul class="nav navbar-nav navbar-right">
<li>
<a href="/guides">Guides</a>
<a href="<%= latest_stable_version_guides_path %>">Guides</a>
</li>
<li>
<a href="/community">Community</a>
Expand Down

0 comments on commit 70683ba

Please sign in to comment.