forked from apache/shardingsphere-doc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·44 lines (30 loc) · 998 Bytes
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
cd `dirname $0`
rm -rf target
mkdir target
cp -rf homepage/. target
mkdir -p target/document/legacy/1.x
mkdir -p target/document/legacy/2.x
mkdir -p target/document/legacy/3.x
cp -rf document/legacy/1.x/cn target/document/legacy/1.x/cn
cp -rf document/legacy/2.x/cn target/document/legacy/2.x/cn
cp -rf document/legacy/2.x/en target/document/legacy/2.x/en
cp -rf document/legacy/3.x/* target/document/legacy/3.x/
cd document/current
hugo
find ./ -name '*.html' -exec sed -i -e 's|[[:space:]]*<option id="\([a-zA-Z]\+\)" value="|<option id="\1" value="/document/current|g' {} \;
cd public/en
sed -i -e 's/cn/en/g' index.html
cd ../..
cd ..
cd ..
mv document/current/public target/document/current
mkdir target/community
cd community/
hugo
find ./ -name '*.html' -exec sed -i -e 's|[[:space:]]*<option id="\([a-zA-Z]\+\)" value="|<option id="\1" value="/community|g' {} \;
cd public/en
sed -i -e 's/cn/en/g' index.html
cd ../..
cd ..
mv community/public/* target/community/