Skip to content

Commit 3aae22d

Browse files
committed
docs: add redirect page for types page
1 parent ca1806b commit 3aae22d

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/make.jl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,34 @@ makedocs(;
1111
warnonly=true,
1212
)
1313

14+
# Forward links from old docs:
15+
16+
redirect_page = """
17+
<!DOCTYPE html>
18+
<html lang="en">
19+
<head>
20+
<meta charset="UTF-8">
21+
<title>Redirecting...</title>
22+
<script type="text/javascript">
23+
var fragment = window.location.hash;
24+
window.location.href = "../api/" + fragment;
25+
</script>
26+
</head>
27+
<body>
28+
<p>If you are not redirected automatically, follow this <a id="redirect-link" href="../api/">link to API</a>.</p>
29+
<script type="text/javascript">
30+
document.getElementById('redirect-link').href = "../api/" + window.location.hash;
31+
</script>
32+
</body>
33+
</html>
34+
"""
35+
36+
# Create the types directory and write the redirect page
37+
types_dir = joinpath("docs", "build", "types")
38+
mkpath(types_dir)
39+
redirect_file = joinpath(types_dir, "index.html")
40+
open(redirect_file, "w") do f
41+
write(f, redirect_page)
42+
end
43+
1444
deploydocs(; repo="github.com/SymbolicML/DynamicExpressions.jl.git")

0 commit comments

Comments
 (0)