forked from BoboTiG/luma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·43 lines (36 loc) · 1.09 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
SRC_DIR='sources'
DST_DIR='luma'
dev_live() {
sphinx-autobuild \
--host '0.0.0.0' \
--open-browser \
"${SRC_DIR}" \
'_live'
}
build_blog() {
[ -d "${DST_DIR}" ] && /bin/rm -rv "${DST_DIR}"
sphinx-build \
-E \
--color \
"${SRC_DIR}" \
"${DST_DIR}"
# Remove unnecessary files
/bin/rm -v "${DST_DIR}/.buildinfo"
/bin/rm -rv "${DST_DIR}/.doctrees"
/bin/rm -v "${DST_DIR}/genindex.html"
/bin/rm -v "${DST_DIR}/objects.inv"
/bin/rm -rv "${DST_DIR}/_sources"
/bin/rm -v "${DST_DIR}/_static/base-stemmer.js"
/bin/rm -v "${DST_DIR}/_static/basic.css"
/bin/rm -v "${DST_DIR}/_static/check-solid.svg"
/bin/rm -v "${DST_DIR}/_static/copy-button.svg"
/bin/rm -v "${DST_DIR}/_static/copybutton_funcs.js"
/bin/rm -v "${DST_DIR}/_static/file.png"
/bin/rm -v "${DST_DIR}/_static/french-stemmer.js"
/bin/rm -v "${DST_DIR}/_static/minus.png"
/bin/rm -v "${DST_DIR}/_static/translations.js"
# Minify files
python minify.py
}
[ "${1}" == 'live' ] && dev_live || build_blog