Skip to content

Commit

Permalink
[MXNET-250] CSS and .htaccess fix (apache#10286)
Browse files Browse the repository at this point in the history
* css_and_install_fixes

* fixed the broken installation page

* copy install index.html fix to 1.1.0 and master versions

* fixed install.md

* fixed variable definition and install copy logic

* added .htaccess and updated .htaccess copy to root folder

* copy .htaccess to root folder

* updated update_all_version.sh

* fixed renaming of the function call

* reverted back AddVersion.py from master

* removed duplicate master being appended

* commented out AddPackageLink.py to fix the master install page issue

* removed commented out lines and not required
  • Loading branch information
thinksanky authored and zheng-da committed Jun 28, 2018
1 parent dc22b99 commit ed5af91
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 16 deletions.
5 changes: 5 additions & 0 deletions docs/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
RewriteEngine on
RewriteRule ^get_started/why_mxnet.html$ /faq/why_mxnet.html [R=301,L]
RewriteRule ^get_started.*$ /install/ [R=301,L]
RewriteRule ^how_to.*$ /faq/ [R=301,L]
RewriteRule ^api/python/symbol.html$ /api/python/symbol/symbol.html [R=301,L]
4 changes: 1 addition & 3 deletions docs/_static/mxnet.css
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ img {

.navbar .container {
position: relative;
left: 20px;
width: 100%;
align-content: center;
}

@media screen and (max-width: 510px) {
Expand Down Expand Up @@ -393,7 +391,7 @@ div .burgerIcon a {
}

#plusMenu .dropdown-submenu>.dropdown-menu {
left: 138px;
left: 127px;
top: 0;
background: #fff;
}
Expand Down
1 change: 0 additions & 1 deletion docs/build_version_doc/AddVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
with open('tag_list.txt', 'r') as tag_file:
for line in tag_file:
tag_list.append(line.lstrip().rstrip())
tag_list.append('master')

version_str = '<span id="dropdown-menu-position-anchor-version" ' \
'style="position: relative">' \
Expand Down
1 change: 1 addition & 0 deletions docs/build_version_doc/build_all_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ for tag in $tag_list; do
git checkout master -- docs/mxdoc.py
fi
git submodule update || exit 1
git submodule update --init --recursive
make clean
cd docs
make clean
Expand Down
42 changes: 30 additions & 12 deletions docs/build_version_doc/update_all_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
set -e
set -x

MASTER_SOURCE_DIR="../../docs"
STATIC_FILES_DIR="_static"
MXNET_THEME_DIR="_static/mxnet-theme"
BUILD_HTML_DIR="_build/html"

if [ -z "$1" ]
then
echo "Please provide a list of version tags you wish to run. Ex : \"1.1.0 1.0.0 master\""
Expand Down Expand Up @@ -68,31 +73,44 @@ fi
# Write all version numbers into $tag_file for AddVersion.py to use later
# Master is added by that script by default
for tag in $tag_list; do
if [ $tag != 'master' ]
then
echo "$tag" >> "$tag_file"
fi
echo "$tag" >> "$tag_file"
done

function update_mxnet_css {
tag=$1
echo "Begin update fixes.."
# All fixes are done on the master branch of mxnet-incubator repository
# During a nightly build, these fixes will be patched to all the versions in the asf-site repository including the master folder under versions directory.
# copy <master folder location> <version folder location>

echo "Copying mxnet.css from master branch to all versions...."
cp "$MASTER_SOURCE_DIR/$STATIC_FILES_DIR/mxnet.css" "$built/versions/$tag/_static"

echo "Update fixes complete.."
}

# Update the specified tags with the Versions dropdown
for tag in $tag_list; do
# This Python script is expecting the tag_list.txt and it will use that as the entries to populate

python AddVersion.py --root_url "$root_url" --file_path "$built/versions/$tag" --current_version "$tag" || exit 1

if [ $tag != 'master' ]
then
python AddPackageLink.py --file_path "$built/versions/master/install/index.html" \
--current_version "$tag" || exit 1
# Patch any fixes to all versions except 0.11.0.
# Version 0.11.0 has old theme and does not make use of the current mxnet.css
if [ $tag != '0.11.0' ]
then
update_mxnet_css $tag
fi


# Update all the files that are required to go into the root folder or live version
if [ $tag == $tag_default ]
then
cp -a "$built/versions/$tag/." "$built"

echo "Copying .htaccess from default branch to root folder...."
cp "$MASTER_SOURCE_DIR/.htaccess" "$built"
else
file_loc="$built/versions/$tag"
#rm -rf "$file_loc"
#mkdir "$file_loc"
#cp -a $mxnet_folder/docs/_build/html/. "$file_loc"
fi
done

Expand Down

0 comments on commit ed5af91

Please sign in to comment.