2012-09-27 03:26:50 -07:00
|
|
|
require "rubygems"
|
2013-10-12 19:53:19 -04:00
|
|
|
|
2019-04-23 09:18:45 -07:00
|
|
|
require "rack/conditional"
|
2013-10-15 09:03:48 -04:00
|
|
|
require "rack/rewrite"
|
2019-03-04 13:04:23 -08:00
|
|
|
require "rack/ssl"
|
2013-10-16 23:46:28 -04:00
|
|
|
require "rack/contrib/not_found"
|
|
|
|
require "rack/contrib/try_static"
|
2013-10-13 15:42:08 -04:00
|
|
|
|
2019-04-23 09:18:45 -07:00
|
|
|
# Make sure we don't force SSL on domains that don't have SSL certificates.
|
|
|
|
use Rack::Conditional, proc {|env| env["SERVER_NAME"] == "sass-lang.com"}, Rack::SSL
|
2019-03-04 13:04:23 -08:00
|
|
|
|
2013-10-15 09:03:48 -04:00
|
|
|
use Rack::Rewrite do
|
|
|
|
r301 %r{/docs/yardoc/(.*)}, '/documentation/$1'
|
|
|
|
r301 '/tutorial.html', '/guide'
|
|
|
|
r301 '/download.html', '/install'
|
2013-10-15 13:53:50 -07:00
|
|
|
r301 '/try', 'http://sassmeister.com'
|
2013-10-15 12:08:20 -07:00
|
|
|
r301 '/try.html', 'http://sassmeister.com'
|
2013-10-24 17:44:23 -07:00
|
|
|
r301 '/about', '/'
|
|
|
|
r301 '/about.html', '/'
|
2018-12-03 16:41:00 -08:00
|
|
|
|
2018-12-28 16:26:21 -08:00
|
|
|
r301 '/documentation/file.SASS_REFERENCE.html', '/documentation'
|
2018-12-03 16:41:00 -08:00
|
|
|
r301 '/documentation/file.SASS_CHANGELOG.html', 'https://github.com/sass/dart-sass/blob/master/CHANGELOG.md'
|
|
|
|
r301 '/documentation/file.INDENTED_SYNTAX.html', '/documentation/syntax'
|
|
|
|
r301 '/documentation/file.SCSS_FOR_SASS_USERS.html', '/documentation/syntax'
|
2019-09-02 15:20:24 -07:00
|
|
|
r301 '/documentation/Sass/Script/Functions.html', '/documentation/modules'
|
|
|
|
r301 '/documentation/Sass/Script/Functions', '/documentation/modules'
|
2018-12-03 16:41:00 -08:00
|
|
|
r301 %r{/documentation/(Sass.*)}, 'http://www.rubydoc.info/gems/sass/$1'
|
2019-09-02 16:10:40 -07:00
|
|
|
r301 '/documentation/functions/css', '/documentation/at-rules/function#plain-css-functions'
|
2019-09-02 15:20:24 -07:00
|
|
|
r301 %r{/documentation/functions(.*)}, '/documentation/modules$1'
|
2018-12-28 16:26:21 -08:00
|
|
|
|
|
|
|
r301 %r{/(.+)/$}, '/$1'
|
|
|
|
r301 %r{/(.+)/index\.html$}, '/$1'
|
2019-04-17 17:42:31 -07:00
|
|
|
|
2019-04-03 17:40:45 -07:00
|
|
|
r301 %r{/blog/(.*)}, 'http://sass.logdown.com/$1'
|
2019-06-04 12:57:17 +01:00
|
|
|
|
|
|
|
# Provide short links for breaking changes so that they can be tersely
|
|
|
|
# referenced from warning and errors.
|
|
|
|
r301 %r{/d/(.*)}, '/documentation/breaking-changes/$1'
|
2019-02-22 17:12:22 -08:00
|
|
|
end
|
2013-10-13 15:42:08 -04:00
|
|
|
|
2013-10-16 23:51:08 -04:00
|
|
|
use Rack::Deflater
|
|
|
|
|
2018-12-28 16:38:26 -08:00
|
|
|
use Rack::TryStatic,
|
|
|
|
urls: ["/"], root: 'build', index: 'index.html',
|
|
|
|
try: ['.html', '/index.html']
|
2013-10-16 23:46:28 -04:00
|
|
|
|
2018-12-28 16:38:26 -08:00
|
|
|
run Rack::NotFound.new("build/404.html")
|