|
|
@ -287,7 +287,8 @@ class App < Sinatra::Application
|
|
|
|
'angular~1.2' => 'angularjs~1.2'
|
|
|
|
'angular~1.2' => 'angularjs~1.2'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
get %r{\A/([\w~\.]+)(\-[\w\-]+)?(/.*)?\z} do |doc, type, rest|
|
|
|
|
get %r{\A/([\w~\.%]+)(\-[\w\-]+)?(/.*)?\z} do |doc, type, rest|
|
|
|
|
|
|
|
|
doc.sub! '%7E', '~'
|
|
|
|
return redirect "/#{DOC_REDIRECTS[doc]}#{type}#{rest}" if DOC_REDIRECTS.key?(doc)
|
|
|
|
return redirect "/#{DOC_REDIRECTS[doc]}#{type}#{rest}" if DOC_REDIRECTS.key?(doc)
|
|
|
|
return redirect "/angularjs/api#{rest}", 301 if doc == 'angular' && rest.start_with?('/ng')
|
|
|
|
return redirect "/angularjs/api#{rest}", 301 if doc == 'angular' && rest.start_with?('/ng')
|
|
|
|
return 404 unless @doc = find_doc(doc)
|
|
|
|
return 404 unless @doc = find_doc(doc)
|
|
|
|