mirror of
https://github.com/danog/sass-site.git
synced 2024-11-30 04:29:17 +01:00
df428f62b2
This isn't ideal, since these functions aren't defined with @function, but there's not really a better place to put it. It certainly doesn't make sense in the built-in module documentation anymore.
48 lines
1.7 KiB
Ruby
48 lines
1.7 KiB
Ruby
require "rubygems"
|
|
|
|
require "rack/conditional"
|
|
require "rack/rewrite"
|
|
require "rack/ssl"
|
|
require "rack/contrib/not_found"
|
|
require "rack/contrib/try_static"
|
|
|
|
# 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
|
|
|
|
use Rack::Rewrite do
|
|
r301 %r{/docs/yardoc/(.*)}, '/documentation/$1'
|
|
r301 '/tutorial.html', '/guide'
|
|
r301 '/download.html', '/install'
|
|
r301 '/try', 'http://sassmeister.com'
|
|
r301 '/try.html', 'http://sassmeister.com'
|
|
r301 '/about', '/'
|
|
r301 '/about.html', '/'
|
|
|
|
r301 '/documentation/file.SASS_REFERENCE.html', '/documentation'
|
|
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'
|
|
r301 '/documentation/Sass/Script/Functions.html', '/documentation/modules'
|
|
r301 '/documentation/Sass/Script/Functions', '/documentation/modules'
|
|
r301 %r{/documentation/(Sass.*)}, 'http://www.rubydoc.info/gems/sass/$1'
|
|
r301 '/documentation/functions/css', '/documentation/at-rules/function#plain-css-functions'
|
|
r301 %r{/documentation/functions(.*)}, '/documentation/modules$1'
|
|
|
|
r301 %r{/(.+)/$}, '/$1'
|
|
r301 %r{/(.+)/index\.html$}, '/$1'
|
|
|
|
r301 %r{/blog/(.*)}, 'http://sass.logdown.com/$1'
|
|
|
|
# Provide short links for breaking changes so that they can be tersely
|
|
# referenced from warning and errors.
|
|
r301 %r{/d/(.*)}, '/documentation/breaking-changes/$1'
|
|
end
|
|
|
|
use Rack::Deflater
|
|
|
|
use Rack::TryStatic,
|
|
urls: ["/"], root: 'build', index: 'index.html',
|
|
try: ['.html', '/index.html']
|
|
|
|
run Rack::NotFound.new("build/404.html")
|