Skip to content

Commit

Permalink
Merge pull request #624 from tnir/tnir-aggregate-old-guides-before-v1.15
Browse files Browse the repository at this point in the history
Aggregate guides for 1.12-1.14 to 1.15
  • Loading branch information
deivid-rodriguez authored Jul 6, 2022
2 parents 06a4f6b + 77b35b0 commit a6757bd
Show file tree
Hide file tree
Showing 14 changed files with 10 additions and 6,483 deletions.
8 changes: 8 additions & 0 deletions config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@
end
end

# Redirect old localizable guides (v1.12-v1.14) to the latest version (1.15) of guide compatible with Ruby 1.8.x
["", "pl/"].each do |lang|
%w[1.12 1.13 1.14].each do |version|
redirect "#{lang}v#{version}/guides/creating_gem.html", to: "#{lang}v1.15/guides/creating_gem.html"
redirect "#{lang}v#{version}/guides/using_bundler_in_applications.html", to: "#{lang}v1.15/using_bundler_in_applications.html"
end
end

redirect "sponsors.html", to: "https://rubygems.org/pages/sponsors" # Backwards compatibility

page '/conduct.html', layout: :guides_layout
Expand Down
3 changes: 2 additions & 1 deletion helpers/guides_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module GuidesHelper

def guides
guides = Dir.glob("./source/#{current_visible_version}/guides/*")
localizable_guides = Dir.glob("./source/localizable/#{current_visible_version}/guides/*.en.html.md")
target_version = [current_visible_version, "v1.15"].max
localizable_guides = Dir.glob("./source/localizable/#{target_version}/guides/*.en.html.md")
all_guides = guides + localizable_guides + ADDITIONAL_GUIDES

guides = all_guides.map do |filename|
Expand Down
Loading

0 comments on commit a6757bd

Please sign in to comment.