Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix error redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmarkham committed Jan 23, 2019
1 parent 4c88f30 commit 764704f
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 76 deletions.
2 changes: 1 addition & 1 deletion docs/build_version_doc/artifacts/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ RewriteRule ^versions/1.0.0/api/clojure/.*$ %{ENV:default_version}/error/api.htm
RewriteRule ^versions/1.1.0/api/clojure/.*$ %{ENV:default_version}/error/api.html [R=301,L]
RewriteRule ^versions/1.2.1/api/clojure/.*$ %{ENV:default_version}/error/api.html [R=301,L]

ErrorDocument 404 https://mxnet.incubator.apache.org/error/404.html
ErrorDocument 404 /error/404.html
50 changes: 50 additions & 0 deletions docs/build_version_doc/artifacts/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
{ margin: 0; padding: 0; }

html {
background: url('https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-background-compressed.jpeg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

h1, p {
color: white;
font-family: verdana;
}

a:link {
color: white;
}

a:visited {
color: linen;
}

a:hover {
color: powderblue;
}

a:active {
color: aqua;
}

</style>
</head>
<body>
<div>
<a href="/" id="logo" ><img width="200" src="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet_logo.png"></a>
</div>
<div>
<span id="page-does-not-exist"></span><h1>Page Does Not Exist</h1>
<p>If you’re here that means you requested a page that doesn’t exist. Sorry about that! Maybe try the search box to find what you’re looking for, or navigate to the <a href="https://mxnet.incubator.apache.org/index.html">Home Page</a>. Also, make sure you’re looking in the correct version, as some features may only be available in <a href="https://github.com/apache/incubator-mxnet/releases">newer versions</a> or the <a href="https://mxnet.incubator.apache.org/versions/master">master branch</a>.</p>
</div>
</body>
</html>
50 changes: 50 additions & 0 deletions docs/build_version_doc/artifacts/api.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
{ margin: 0; padding: 0; }

html {
background: url('https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-background-compressed.jpeg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

h1, p {
color: white;
font-family: verdana;
}

a:link {
color: white;
}

a:visited {
color: linen;
}

a:hover {
color: powderblue;
}

a:active {
color: aqua;
}

</style>
</head>
<body>
<div>
<a href="/" id="logo" ><img width="200" src="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet_logo.png"></a>
</div>
<div>
<span id="page-does-not-exist"></span><h1>API Not Available</h1>
<p>You selected an API that is not available for this version of MXNet. Try a more recent version of MXNet, or go the <a href="/versions/master">master branch</a>.</p>
</div>
</body>
</html>
73 changes: 0 additions & 73 deletions docs/build_version_doc/artifacts/index.html

This file was deleted.

10 changes: 9 additions & 1 deletion docs/build_version_doc/update_all_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,14 @@ function update_mxnet_css {
echo "Update fixes complete.."
}


function update_error_pages {
tag=$1
# Static error pages avoid many issues with redirects and templating
echo "Copying error pages from artifacts folder..."
cp "artifacts/404.html" "$built/versions/$tag/error"
cp "artifacts/api.html" "$built/versions/$tag/error"
echo "Error copies complete..."
}

# Update the specified tags with the Versions dropdown
# Add various artifacts depending on the version
Expand All @@ -108,6 +115,7 @@ for tag in $tag_list; do
if [ -d $built/versions/$tag ]; then
echo "The $tag is going to be updated with new css and install pages."
update_mxnet_css $tag
update_error_pages $tag
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['3rdparty', 'api/python/model.md', 'build_version_doc', 'error', 'README.md', 'tutorial_utils', 'virtualenv']
exclude_patterns = ['3rdparty', 'api/python/model.md', 'build_version_doc', 'README.md', 'tutorial_utils', 'virtualenv']


# The reST default role (used for this markup: `text`) to use for all documents.
Expand Down

0 comments on commit 764704f

Please sign in to comment.