Make all client-side redirect URLs absolute

These used to redirect from /documentation/, but we tweaked the way
URLs work and now they redirect from /documentation. Making them
absolute avoids even the potential for that breakage.
This commit is contained in:
Natalie Weizenbaum 2019-05-08 13:03:45 -07:00
parent 79097d0fe1
commit 084e181580

View File

@ -4,88 +4,88 @@
if (window.location.hash) { if (window.location.hash) {
if (window.location.pathname == "/documentation") { if (window.location.pathname == "/documentation") {
var redirects = { var redirects = {
"#syntax": "syntax", "#syntax": "/documentation/syntax",
"#using_sass": "/install", "#using_sass": "/install",
"#rackrailsmerb_plugin": "https://github.com/rails/sass-rails", "#rackrailsmerb_plugin": "https://github.com/rails/sass-rails",
"#caching": "/ruby-sass", "#caching": "/ruby-sass",
"#options": "/ruby-sass", "#options": "/ruby-sass",
"#syntax_selection": "syntax", "#syntax_selection": "/documentation/syntax",
"#encodings": "syntax/parsing#input-encoding", "#encodings": "/documentation/syntax/parsing#input-encoding",
"#css_extensions": "style-rules", "#css_extensions": "/documentation/style-rules",
"#nested_rules": "style-rules#nesting", "#nested_rules": "/documentation/style-rules#nesting",
"#parent-selector": "style-rules/parent-selector", "#parent-selector": "/documentation/style-rules/parent-selector",
"#nested_properties": "style-rules/declarations#nesting", "#nested_properties": "/documentation/style-rules/declarations#nesting",
"#placeholder_selectors_foo": "style-rules/placeholder-selectors", "#placeholder_selectors_foo": "/documentation/style-rules/placeholder-selectors",
"#comments": "syntax/comments", "#comments": "/documentation/syntax/comments",
"#sassscript": "syntax/structure#expressions", "#sassscript": "/documentation/syntax/structure#expressions",
"#interactive_shell": "cli/dart-sass#interactive", "#interactive_shell": "/documentation/cli/dart-sass#interactive",
"#variables_": "variables", "#variables_": "/documentation/variables",
"#data_types": "values", "#data_types": "/documentation/values",
"#strings": "values/strings", "#strings": "/documentation/values/strings",
"#lists": "values/lists", "#lists": "/documentation/values/lists",
"#bracketed_lists": "values/lists", "#bracketed_lists": "/documentation/values/lists",
"#maps": "values/maps", "#maps": "/documentation/values/maps",
"#colors": "values/colors", "#colors": "/documentation/values/colors",
"#first_class_functions": "values/functions", "#first_class_functions": "/documentation/values/functions",
"#operations": "operators", "#operations": "/documentation/operators",
"#number_operations": "operators/numeric", "#number_operations": "/documentation/operators/numeric",
"#division-and-slash": "operators/numeric#slash-separated-values", "#division-and-slash": "/documentation/operators/numeric#slash-separated-values",
"#subtraction": "operators/numeric#unary-operators", "#subtraction": "/documentation/operators/numeric#unary-operators",
"#color_operations": "operators/color", "#color_operations": "/documentation/operators/color",
"#string_operations": "operators/string", "#string_operations": "/documentation/operators/string",
"#boolean_operations": "operators/boolean", "#boolean_operations": "/documentation/operators/boolean",
"#list_operations": "functions/list", "#list_operations": "/documentation/functions/list",
"#parentheses": "operators#parentheses", "#parentheses": "/documentation/operators#parentheses",
"#functions": "functions", "#functions": "/documentation/functions",
"#keyword_arguments": "at-rules/function#keyword-arguments", "#keyword_arguments": "/documentation/at-rules/function#keyword-arguments",
"#interpolation_": "interpolation", "#interpolation_": "/documentation/interpolation",
"#parent-script": "style-rules/parent-selector#in-sassscript", "#parent-script": "/documentation/style-rules/parent-selector#in-sassscript",
"#variable_defaults_default": "variables#default-values", "#variable_defaults_default": "/documentation/variables#default-values",
"#directives": "at-rules", "#directives": "/documentation/at-rules",
"#import": "at-rules/import", "#import": "/documentation/at-rules/import",
"#partials": "at-rules/import#partials", "#partials": "/documentation/at-rules/import#partials",
"#index_files": "at-rules/import#index-files", "#index_files": "/documentation/at-rules/import#index-files",
"#nested_import": "at-rules/import#nesting", "#nested_import": "/documentation/at-rules/import#nesting",
"#media": "at-rules/css#media", "#media": "/documentation/at-rules/css#media",
"#extend": "at-rules/extend", "#extend": "/documentation/at-rules/extend",
"#how_it_works": "at-rules/extend#how-it-works", "#how_it_works": "/documentation/at-rules/extend#how-it-works",
"#multiple_extends": "at-rules/extend", "#multiple_extends": "/documentation/at-rules/extend",
"#chaining_extends": "at-rules/extend", "#chaining_extends": "/documentation/at-rules/extend",
"#selector_sequences": "at-rules/extend#disallowed-selectors", "#selector_sequences": "/documentation/at-rules/extend#disallowed-selectors",
"#merging_selector_sequences": "at-rules/extend#how-it-works", "#merging_selector_sequences": "/documentation/at-rules/extend#how-it-works",
"#placeholders": "at-rules/extend#placeholder-selectors", "#placeholders": "/documentation/at-rules/extend#placeholder-selectors",
"#the_optional_flag": "at-rules/extend#mandatory-and-optional-extends", "#the_optional_flag": "/documentation/at-rules/extend#mandatory-and-optional-extends",
"#extend_in_directives": "at-rules/extend#extend-in-media", "#extend_in_directives": "/documentation/at-rules/extend#extend-in-media",
"#extending_compound_selectors": "at-rules/extend#disallowed-selectors", "#extending_compound_selectors": "/documentation/at-rules/extend#disallowed-selectors",
"#at-root": "at-rules/at-root", "#at-root": "/documentation/at-rules/at-root",
"#at-root_without__and_at-root_with_": "at-rules/at-root#beyond-style-rules", "#at-root_without__and_at-root_with_": "/documentation/at-rules/at-root#beyond-style-rules",
"#debug": "at-rules/debug", "#debug": "/documentation/at-rules/debug",
"#warn": "at-rules/warn", "#warn": "/documentation/at-rules/warn",
"#error": "at-rules/error", "#error": "/documentation/at-rules/error",
"#control_directives__expressions": "at-rules/control", "#control_directives__expressions": "/documentation/at-rules/control",
"#if": "at-rules/control/if", "#if": "/documentation/at-rules/control/if",
"#for": "at-rules/control/for", "#for": "/documentation/at-rules/control/for",
"#each": "at-rules/control/each", "#each": "/documentation/at-rules/control/each",
"#each-multi-assign": "at-rules/control/each#destructuring", "#each-multi-assign": "/documentation/at-rules/control/each#destructuring",
"#while": "at-rules/control/while", "#while": "/documentation/at-rules/control/while",
"#mixins": "at-rules/mixin", "#mixins": "/documentation/at-rules/mixin",
"#defining_a_mixin": "at-rules/mixin", "#defining_a_mixin": "/documentation/at-rules/mixin",
"#including_a_mixin": "at-rules/mixin", "#including_a_mixin": "/documentation/at-rules/mixin",
"#mixin-arguments": "at-rules/mixin#arguments", "#mixin-arguments": "/documentation/at-rules/mixin#arguments",
"#trailing_commas": "at-rules/mixin#arguments", "#trailing_commas": "/documentation/at-rules/mixin#arguments",
"#variable_arguments": "at-rules/mixin#taking-arbitrary-arguments", "#variable_arguments": "/documentation/at-rules/mixin#taking-arbitrary-arguments",
"#mixin-content": "at-rules/mixin#content-blocks", "#mixin-content": "/documentation/at-rules/mixin#content-blocks",
"#variable_scope_and_content_blocks": "at-rules/mixin#content-blocks", "#variable_scope_and_content_blocks": "/documentation/at-rules/mixin#content-blocks",
"#function_directives": "at-rules/function", "#function_directives": "/documentation/at-rules/function",
"#output_style": "cli/dart-sass#style", "#output_style": "/documentation/cli/dart-sass#style",
"#expanded": "cli/dart-sass#style", "#expanded": "/documentation/cli/dart-sass#style",
"#compressed": "cli/dart-sass#style", "#compressed": "/documentation/cli/dart-sass#style",
"#nested": "cli/ruby-sass#style", "#nested": "/documentation/cli/ruby-sass#style",
"#compact": "cli/ruby-sass#style", "#compact": "/documentation/cli/ruby-sass#style",
"#extending_sass": "js-api", "#extending_sass": "/documentation/js-api",
"#defining_custom_sass_functions": "js-api#functions", "#defining_custom_sass_functions": "/documentation/js-api#functions",
"#cache_stores": "/ruby-sass", "#cache_stores": "/ruby-sass",
"#custom_importers": "js-api#importers" "#custom_importers": "/documentation/js-api#importers"
}; };
var redirect = redirects[window.location.hash]; var redirect = redirects[window.location.hash];
@ -103,87 +103,87 @@ if (window.location.hash) {
"#random_number_generator-class_method": "/ruby-sass", "#random_number_generator-class_method": "/ruby-sass",
"#random_seed=-class_method": "/ruby-sass", "#random_seed=-class_method": "/ruby-sass",
"#signature-class_method": "/ruby-sass", "#signature-class_method": "/ruby-sass",
"#abs-instance_method": "functions/math#abs", "#abs-instance_method": "/documentation/functions/math#abs",
"#adjust_color-instance_method": "functions/color#adjust-color", "#adjust_color-instance_method": "/documentation/functions/color#adjust-color",
"#adjust_hue-instance_method": "functions/color#adjust-hue", "#adjust_hue-instance_method": "/documentation/functions/color#adjust-hue",
"#alpha-instance_method": "functions/color#alpha", "#alpha-instance_method": "/documentation/functions/color#alpha",
"#append-instance_method": "functions/list#append", "#append-instance_method": "/documentation/functions/list#append",
"#blue-instance_method": "functions/color#blue", "#blue-instance_method": "/documentation/functions/color#blue",
"#call-instance_method": "functions/meta#call", "#call-instance_method": "/documentation/functions/meta#call",
"#ceil-instance_method": "functions/math#ceil", "#ceil-instance_method": "/documentation/functions/math#ceil",
"#change_color-instance_method": "functions/color#change-color", "#change_color-instance_method": "/documentation/functions/color#change-color",
"#comparable-instance_method": "functions/math#comparable", "#comparable-instance_method": "/documentation/functions/math#comparable",
"#complement-instance_method": "functions/color#complement", "#complement-instance_method": "/documentation/functions/color#complement",
"#content_exists-instance_method": "functions/meta#content-exists", "#content_exists-instance_method": "/documentation/functions/meta#content-exists",
"#darken-instance_method": "functions/color#darken", "#darken-instance_method": "/documentation/functions/color#darken",
"#desaturate-instance_method": "functions/color#desaturate", "#desaturate-instance_method": "/documentation/functions/color#desaturate",
"#feature_exists-instance_method": "functions/meta#feature-exists", "#feature_exists-instance_method": "/documentation/functions/meta#feature-exists",
"#floor-instance_method": "functions/math#floor", "#floor-instance_method": "/documentation/functions/math#floor",
"#get_function-instance_method": "functions/meta#get-function", "#get_function-instance_method": "/documentation/functions/meta#get-function",
"#global_variable_exists-instance_method": "functions/meta#global-variable-exists", "#global_variable_exists-instance_method": "/documentation/functions/meta#global-variable-exists",
"#grayscale-instance_method": "functions/color#grayscale", "#grayscale-instance_method": "/documentation/functions/color#grayscale",
"#green-instance_method": "functions/color#green", "#green-instance_method": "/documentation/functions/color#green",
"#hsl-instance_method": "functions/color#hsl", "#hsl-instance_method": "/documentation/functions/color#hsl",
"#hsla-instance_method": "functions/color#hsla", "#hsla-instance_method": "/documentation/functions/color#hsla",
"#hue-instance_method": "functions/color#hue", "#hue-instance_method": "/documentation/functions/color#hue",
"#ie_hex_str-instance_method": "functions/color#ie-hex-str", "#ie_hex_str-instance_method": "/documentation/functions/color#ie-hex-str",
"#if-instance_method": "#if", "#if-instance_method": "/documentation/#if",
"#index-instance_method": "functions/list#index", "#index-instance_method": "/documentation/functions/list#index",
"#inspect-instance_method": "functions/meta#inspect", "#inspect-instance_method": "/documentation/functions/meta#inspect",
"#invert-instance_method": "functions/color#invert", "#invert-instance_method": "/documentation/functions/color#invert",
"#is_bracketed-instance_method": "functions/list#is-bracketed", "#is_bracketed-instance_method": "/documentation/functions/list#is-bracketed",
"#is_superselector-instance_method": "functions/selector#is-superselector", "#is_superselector-instance_method": "/documentation/functions/selector#is-superselector",
"#join-instance_method": "functions/list#join", "#join-instance_method": "/documentation/functions/list#join",
"#keywords-instance_method": "functions/meta#keywords", "#keywords-instance_method": "/documentation/functions/meta#keywords",
"#length-instance_method": "functions/list#length", "#length-instance_method": "/documentation/functions/list#length",
"#lighten-instance_method": "functions/color#lighten", "#lighten-instance_method": "/documentation/functions/color#lighten",
"#lightness-instance_method": "functions/color#lightness", "#lightness-instance_method": "/documentation/functions/color#lightness",
"#list_separator-instance_method": "functions/list#list-separator", "#list_separator-instance_method": "/documentation/functions/list#list-separator",
"#map_get-instance_method": "functions/map#map-get", "#map_get-instance_method": "/documentation/functions/map#map-get",
"#map_has_key-instance_method": "functions/map#map-has-key", "#map_has_key-instance_method": "/documentation/functions/map#map-has-key",
"#map_keys-instance_method": "functions/map#map-keys", "#map_keys-instance_method": "/documentation/functions/map#map-keys",
"#map_merge-instance_method": "functions/map#map-merge", "#map_merge-instance_method": "/documentation/functions/map#map-merge",
"#map_remove-instance_method": "functions/map#map-remove", "#map_remove-instance_method": "/documentation/functions/map#map-remove",
"#map_values-instance_method": "functions/map#map-values", "#map_values-instance_method": "/documentation/functions/map#map-values",
"#max-instance_method": "functions/math#max", "#max-instance_method": "/documentation/functions/math#max",
"#min-instance_method": "functions/math#min", "#min-instance_method": "/documentation/functions/math#min",
"#mix-instance_method": "functions/color#mix", "#mix-instance_method": "/documentation/functions/color#mix",
"#mixin_exists-instance_method": "functions/meta#mixin-exists", "#mixin_exists-instance_method": "/documentation/functions/meta#mixin-exists",
"#nth-instance_method": "functions/list#nth", "#nth-instance_method": "/documentation/functions/list#nth",
"#opacify-instance_method": "functions/color#opacify", "#opacify-instance_method": "/documentation/functions/color#opacify",
"#opacity-instance_method": "functions/color#opacity", "#opacity-instance_method": "/documentation/functions/color#opacity",
"#percentage-instance_method": "functions/math#percentage", "#percentage-instance_method": "/documentation/functions/math#percentage",
"#quote-instance_method": "functions/string#quote", "#quote-instance_method": "/documentation/functions/string#quote",
"#random-instance_method": "functions/math#random", "#random-instance_method": "/documentation/functions/math#random",
"#red-instance_method": "functions/color#red", "#red-instance_method": "/documentation/functions/color#red",
"#rgb-instance_method": "functions/color#rgb", "#rgb-instance_method": "/documentation/functions/color#rgb",
"#rgba-instance_method": "functions/color#rgba", "#rgba-instance_method": "/documentation/functions/color#rgba",
"#round-instance_method": "functions/math#round", "#round-instance_method": "/documentation/functions/math#round",
"#saturate-instance_method": "functions/color#saturate", "#saturate-instance_method": "/documentation/functions/color#saturate",
"#saturation-instance_method": "functions/color#saturation", "#saturation-instance_method": "/documentation/functions/color#saturation",
"#scale_color-instance_method": "functions/color#scale-color", "#scale_color-instance_method": "/documentation/functions/color#scale-color",
"#selector_append-instance_method": "functions/selector#selector-append", "#selector_append-instance_method": "/documentation/functions/selector#selector-append",
"#selector_extend-instance_method": "functions/selector#selector-extend", "#selector_extend-instance_method": "/documentation/functions/selector#selector-extend",
"#selector_nest-instance_method": "functions/selector#selector-nest", "#selector_nest-instance_method": "/documentation/functions/selector#selector-nest",
"#selector_parse-instance_method": "functions/selector#selector-parse", "#selector_parse-instance_method": "/documentation/functions/selector#selector-parse",
"#selector_replace-instance_method": "functions/selector#selector-replace", "#selector_replace-instance_method": "/documentation/functions/selector#selector-replace",
"#selector_unify-instance_method": "functions/selector#selector-unify", "#selector_unify-instance_method": "/documentation/functions/selector#selector-unify",
"#set-instance_method": "functions/list#set", "#set-instance_method": "/documentation/functions/list#set",
"#simple_selectors-instance_method": "functions/selector#simple-selectors", "#simple_selectors-instance_method": "/documentation/functions/selector#simple-selectors",
"#str_index-instance_method": "functions/string#str-index", "#str_index-instance_method": "/documentation/functions/string#str-index",
"#str_insert-instance_method": "functions/string#str-insert", "#str_insert-instance_method": "/documentation/functions/string#str-insert",
"#str_length-instance_method": "functions/string#str-length", "#str_length-instance_method": "/documentation/functions/string#str-length",
"#str_slice-instance_method": "functions/string#str-slice", "#str_slice-instance_method": "/documentation/functions/string#str-slice",
"#to_lower_case-instance_method": "functions/string#to-lower-case", "#to_lower_case-instance_method": "/documentation/functions/string#to-lower-case",
"#to_upper_case-instance_method": "functions/string#to-upper-case", "#to_upper_case-instance_method": "/documentation/functions/string#to-upper-case",
"#transparentize-instance_method": "functions/color#transparentize", "#transparentize-instance_method": "/documentation/functions/color#transparentize",
"#type_of-instance_method": "functions/meta#type-of", "#type_of-instance_method": "/documentation/functions/meta#type-of",
"#unique_id-instance_method": "functions/string#unique-id", "#unique_id-instance_method": "/documentation/functions/string#unique-id",
"#unit-instance_method": "functions/math#unit", "#unit-instance_method": "/documentation/functions/math#unit",
"#unitless-instance_method": "functions/math#unitless", "#unitless-instance_method": "/documentation/functions/math#unitless",
"#unquote-instance_method": "functions/string#unquote", "#unquote-instance_method": "/documentation/functions/string#unquote",
"#variable_exists-instance_method": "functions/meta#variable-exists", "#variable_exists-instance_method": "/documentation/functions/meta#variable-exists",
"#zip-instance_method": "functions/list#zip" "#zip-instance_method": "/documentation/functions/list#zip"
}; };
var redirect = redirects[window.location.hash]; var redirect = redirects[window.location.hash];