Skip to content

Commit 99fbd56

Browse files
committed
Drop broken logic the top-level page doesn't need.
Due to a key not being found in the dictionary, this logic redirects to: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/undefined It isn't needed here anyhow, because there aren't any headings on the top-level page to map from the legacy system to the DocC version.
1 parent 46765d3 commit 99fbd56

File tree

1 file changed

+0
-72
lines changed

1 file changed

+0
-72
lines changed

bin/redirects/index.html

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -17,79 +17,7 @@
1717
<script>
1818
const baseURL = "https://docs.swift.org/swift-book/documentation/the-swift-programming-language/";
1919

20-
const headingRedirects = {
21-
"#ID461": "guidedtour#Simple-Values",
22-
"#ID462": "guidedtour#Control-Flow",
23-
"#ID463": "guidedtour#Functions-and-Closures",
24-
}
25-
26-
const chapterRedirects = {
27-
"GuidedTour/GuidedTour.html": "guidedtour",
28-
"GuidedTour/AboutSwift.html": "aboutswift",
29-
"GuidedTour/Compatibility.html": "compatibility",
30-
"GuidedTour/GuidedTour.html": "guidedtour",
31-
"GuidedTour/GuidedTourPart.html": "guidedtour",
32-
33-
"LanguageGuide/AccessControl.html": "accesscontrol",
34-
"LanguageGuide/AdvancedOperators.html": "advancedoperators",
35-
"LanguageGuide/AutomaticReferenceCounting.html": "automaticreferencecounting",
36-
"LanguageGuide/BasicOperators.html": "basicoperators",
37-
"LanguageGuide/ClassesAndStructures.html": "classesandstructures",
38-
"LanguageGuide/Closures.html": "closures",
39-
"LanguageGuide/CollectionTypes.html": "collectiontypes",
40-
"LanguageGuide/Concurrency.html": "concurrency",
41-
"LanguageGuide/ControlFlow.html": "controlflow",
42-
"LanguageGuide/Deinitialization.html": "deinitialization",
43-
"LanguageGuide/Enumerations.html": "enumerations",
44-
"LanguageGuide/ErrorHandling.html": "errorhandling",
45-
"LanguageGuide/Extensions.html": "extensions",
46-
"LanguageGuide/Functions.html": "functions",
47-
"LanguageGuide/Generics.html": "generics",
48-
"LanguageGuide/Inheritance.html": "inheritance",
49-
"LanguageGuide/Initialization.html": "initialization",
50-
"LanguageGuide/LanguageGuidePart.html": "languageguide",
51-
"LanguageGuide/MemorySafety.html": "memorysafety",
52-
"LanguageGuide/Methods.html": "methods",
53-
"LanguageGuide/NestedTypes.html": "nestedtypes",
54-
"LanguageGuide/OpaqueTypes.html": "opaquetypes",
55-
"LanguageGuide/OptionalChaining.html": "optionalchaining",
56-
"LanguageGuide/Properties.html": "properties",
57-
"LanguageGuide/Protocols.html": "protocols",
58-
"LanguageGuide/StringsAndCharacters.html": "stringsandcharacters",
59-
"LanguageGuide/Subscripts.html": "subscripts",
60-
"LanguageGuide/TheBasics.html": "thebasics",
61-
"LanguageGuide/TypeCasting.html": "typecasting",
62-
63-
"ReferenceManual/AboutTheLanguageReference.html": "aboutthelanguagereference",
64-
"ReferenceManual/Attributes.html": "attributes",
65-
"ReferenceManual/Declarations.html": "declarations",
66-
"ReferenceManual/Expressions.html": "expressions",
67-
"ReferenceManual/GenericParametersAndArguments.html": "genericparametersandarguments",
68-
"ReferenceManual/LexicalStructure.html": "lexicalstructure",
69-
"ReferenceManual/Patterns.html": "patterns",
70-
"ReferenceManual/ReferenceManualPart.html": "referencemanual",
71-
"ReferenceManual/Statements.html": "statements",
72-
"ReferenceManual/Types.html": "types",
73-
"ReferenceManual/zzSummaryOfTheGrammar.html": "summaryofthegrammar",
74-
75-
"RevisionHistory/RevisionHistory.html": "revisionhistory",
76-
"RevisionHistory/RevisionHistoryPart.html": "revisionhistory",
77-
}
78-
79-
const path = window.location.pathname;
80-
const hash = window.location.hash;
81-
8220
var newURL = baseURL;
83-
if (hash == "") {
84-
const components = path.split("/");
85-
const part = components[components.length - 2];
86-
const chapter = components[components.length - 1];
87-
const redirectPath = chapterRedirects[part + "/" + chapter];
88-
newURL += redirectPath;
89-
} else {
90-
const redirectPath = headingRedirects[hash];
91-
newURL += redirectPath;
92-
}
9321

9422
document.getElementById("redirect").setAttribute("href", newURL);
9523
window.location = newURL;

0 commit comments

Comments
 (0)