diff options
author | dzc <dzc@google.com> | 2017-06-07 21:51:52 -0400 |
---|---|---|
committer | John Cater <jcater@google.com> | 2017-06-08 10:52:56 -0400 |
commit | 5596d3bd9e938a3592c4e873763baec0953c9434 (patch) | |
tree | a30349414f1f1fea1e2a99f4f1aac5d103fc5827 /site/jekyll-tree.sh | |
parent | 7dec00574aa91327693f6ba7e90bff5bc834253e (diff) |
Fix paths in Bazel docs, removing references to versions/master.
Follow-up to https://github.com/bazelbuild/bazel/commit/22b85a2a3c79c6f3aef1e0a61e485bb135be4551. This change updates paths and URLs to Bazel docs,
removing the versions/master directory and changing bazel.build/docs to
docs.bazel.build.
For clarification on the convention of the docs site, links referencing
docs.bazel.build/foo.html will be redirected to
docs.bazel.build/versions/master/foo.html. The versions/master directory will
contain the documentation pages pushed from HEAD. Once versioned documentation
is ready, then docs.bazel.build/foo.html will instead be redirected to
docs.bazel.build/x.y.z/foo.html, where x.y.z is the directory for the latest
stable Bazel version.
Follow-ups to this change:
* Add script that will be used by the daily push job that pushes the latest
documentation from HEAD to docs.bazel.build. This script will do the
following:
* Build the Jekyll tree, run jekyll build, and modify the resulting site
tree, moving the docs/ directory into versions/master.
* Add redirects for each of the site pages from the root of the site
to the corresponding page in versions/master.
* This should give us the minimum viable product for the new docs site.
* Add script for cutting a release of the docs and pushing to a new versioned
directory on the docs.bazel.build bucket.
RELNOTES: None
PiperOrigin-RevId: 158347197
Diffstat (limited to 'site/jekyll-tree.sh')
-rwxr-xr-x | site/jekyll-tree.sh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/site/jekyll-tree.sh b/site/jekyll-tree.sh index c2c8e985c6..99e93d507e 100755 --- a/site/jekyll-tree.sh +++ b/site/jekyll-tree.sh @@ -40,14 +40,14 @@ function setup { # Unpack the Build Encyclopedia into docs/be function unpack_build_encyclopedia { - local be_dir="$OUT_DIR/versions/master/docs/be" + local be_dir="$OUT_DIR/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 + for f in $(find "$OUT_DIR/docs/be" -name "*.html"); do local filename=$(basename "$f") cat > "$OUT_DIR/docs/be/${filename}" <<EOF --- @@ -60,14 +60,14 @@ EOF # Unpack the Skylark Library into docs/skylark/lib function unpack_skylark_library { - local sl_dir="$OUT_DIR/versions/master/docs/skylark/lib" + local sl_dir="$OUT_DIR/docs/skylark/lib" mkdir -p "$sl_dir" unzip -qq "$SL_ZIP" -d "$sl_dir" mv "$sl_dir/skylark-nav.html" "$OUT_DIR/_includes" # Create redirects to each page in the Skylark Library mkdir -p "$OUT_DIR/docs/skylark/lib" - for f in $(find "$OUT_DIR/versions/master/docs/skylark/lib" -name "*.html"); do + for f in $(find "$OUT_DIR/docs/skylark/lib" -name "*.html"); do local filename=$(basename "$f") cat > "$OUT_DIR/docs/skylark/lib/${filename}" <<EOF --- @@ -81,7 +81,7 @@ EOF function copy_skylark_rule_doc { local rule_family=$1 local rule_family_name=$2 - local be_dir="$OUT_DIR/versions/master/docs/be" + local be_dir="$OUT_DIR/docs/be" ( cat <<EOF --- @@ -111,10 +111,10 @@ function process_doc { } function process_docs { - for f in $(find "$OUT_DIR/versions/master/docs" -name "*.html"); do + for f in $(find "$OUT_DIR/docs" -name "*.html"); do process_doc $f done - for f in $(find "$OUT_DIR/versions/master/docs" -name "*.md"); do + for f in $(find "$OUT_DIR/docs" -name "*.md"); do process_doc $f done for f in $(find "$OUT_DIR/designs" -name "*.md"); do @@ -132,7 +132,7 @@ function main { unpack_build_encyclopedia unpack_skylark_library unpack_skylark_rule_docs - cp ${CLR_HTML} ${OUT_DIR}/versions/master/docs + cp ${CLR_HTML} ${OUT_DIR}/docs process_docs package_output } |