-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.sh
executable file
·57 lines (45 loc) · 1.26 KB
/
make.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
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# require sassc, python, virtualenv
rm -rf dist/
# Create virtualenv
if [ ! -d ".venv" ];then
virtualenv .venv
. .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
else
. .venv/bin/activate
fi
JSCC='build/closure-compiler-v20161201.jar'
# Reset environment
echo "[+] Clean dist"
rm -rf dist
mkdir -p dist
echo "[+] Copy site map"
cp -vf sitemap.xml dist/sitemap.xml
# Static file
echo "[+] Copy static"
mkdir -p dist/js
cp -r css images fonts pdf index.html dist/
sassc -t compressed -m inline libs/bulma.sass > dist/css/bulma.css
for script in js/*; do
script=$(basename "$script")
java -jar $JSCC --charset utf-8 --js "js/$script" --js_output_file "dist/js/$script"
done
# Generate Pages (be sure we can extract strings)
echo "[+] Compile templates"
python build/generator.py || exit 1
# Internalization
echo "[+] Compile lang"
[[ ! -d "i18n" ]] && ./build/lang.sh -i "$(pwd)/i18n" "$(pwd)/pages"
./build/lang.sh -u "$(pwd)/i18n" "$(pwd)/pages"
./build/lang.sh -c "$(pwd)/i18n" "$(pwd)/pages"
# Generate Pages
echo "[+] Compile templates"
python build/generator.py
# Copy CNAME
echo "[+] Copy CNAME config"
cp CNAME dist/CNAME
echo "[+] Completed"
echo "[+] Starting webserver"
cd dist && python -m SimpleHTTPServer