-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.sh
executable file
·26 lines (22 loc) · 1.06 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
set -euo pipefail
rm -rf docs
mkdir docs
cd ChunkyDocs
CHUNKY_VERSION=20500 python -m mkdocs build
cp -r site ../docs/snapshot
# get the versions from /docs/versions.json instead of the hard-coded ../versions.json
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' 's/..\/versions.json/\/docs\/versions.json/g' ../docs/snapshot/assets/javascripts/bundle*.min.js
else
sed -i 's/..\/versions.json/\/docs\/versions.json/g' ../docs/snapshot/assets/javascripts/bundle*.min.js
fi
CHUNKY_VERSION=20406 python -m mkdocs build
cp -r site/* ../docs/
# get the versions from /docs/versions.json instead of the hard-coded ../versions.json
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' 's/..\/versions.json/\/docs\/versions.json/g' ../docs/assets/javascripts/bundle*.min.js
else
sed -i 's/..\/versions.json/\/docs\/versions.json/g' ../docs/assets/javascripts/bundle*.min.js
fi
echo '[{ "version": "../docs", "title": "2.4.6", "aliases": ["stable"] }, { "version": "../docs/snapshot", "title": "2.5.0 (snapshot)", "aliases": ["snapshot"] }]' > ../docs/versions.json