From 15c09dd1b5dbd7e76fe42d193a79dab8bfc24abc Mon Sep 17 00:00:00 2001 From: David Chen Date: Mon, 29 Aug 2016 08:56:37 +0000 Subject: Replace doc pages with redirects to versioned doc pages. * Add a new `redirect` Jekyll layout. * Replace all pages under docs/ with redirects to corresponding page under versions/master/. * Prepend links on Documentation sidebar, including generated navs for the Skylark Library and Build Encyclopedia, with prefix for versioned directory. * Add code to both the internal jekyll-config.sh and external jekyll-tree.sh to add redirect pages for the Skylark Library and Build Encyclopedia. * Bring the branched User Manual doc up to date with latest changes. -- MOS_MIGRATED_REVID=131568800 --- site/jekyll-tree.sh | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'site/jekyll-tree.sh') diff --git a/site/jekyll-tree.sh b/site/jekyll-tree.sh index d077345fcb..a787963aaa 100755 --- a/site/jekyll-tree.sh +++ b/site/jekyll-tree.sh @@ -40,24 +40,48 @@ function setup { # Unpack the Build Encyclopedia into docs/be function unpack_build_encyclopedia { - local be_dir="$OUT_DIR/docs/be" + local be_dir="$OUT_DIR/versions/master/docs/be" mkdir -p "$be_dir" unzip -qq "$BE_ZIP" -d "$be_dir" mv "$be_dir/be-nav.html" "$OUT_DIR/_includes" + + # Create redirects to each page in the Build Encyclopedia. + mkdir -p "$OUT_DIR/docs/be" + for f in $(find "$OUT_DIR/versions/master/docs/be" -name "*.html"); do + local filename=$(basename "$f") + cat > "$TMPDIR/out/docs/be/${filename}" < "$TMPDIR/out/docs/skylark/lib/${filename}" <