www: prefix latest docs with the minor version

This commit is contained in:
Jorge Aparicio 2019-09-17 09:26:48 +02:00
parent 8135ed4999
commit 2ffe12a0fc

View file

@ -2,6 +2,7 @@ set -euxo pipefail
main() { main() {
local langs=( en ru ) local langs=( en ru )
local latest=0.5
local vers=( 0.4.3 ) local vers=( 0.4.3 )
rm -f .cargo/config rm -f .cargo/config
@ -10,11 +11,13 @@ main() {
local td=$(mktemp -d) local td=$(mktemp -d)
# build latest docs # build latest docs
cp -r target/doc $td/api mkdir $td/$latest
sed 's|URL|rtfm/index.html|g' redirect.html > $td/api/index.html cp -r target/doc $td/$latest/api
sed 's|URL|rtfm/index.html|g' redirect.html > $td/$latest/api/index.html
mkdir $td/book/ mkdir $td/book/
sed 's|URL|book/en|g' redirect.html > $td/index.html sed 's|URL|0.5|g' redirect.html > $td/index.html
sed 's|URL|book/en|g' redirect.html > $td/$latest/index.html
for lang in ${langs[@]}; do for lang in ${langs[@]}; do
( cd book/$lang && mdbook build ) ( cd book/$lang && mdbook build )
cp -r book/$lang/book $td/book/$lang cp -r book/$lang/book $td/book/$lang