forked from DILCISBoard/E-ARK-SIP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-site.sh
executable file
·88 lines (75 loc) · 1.84 KB
/
create-site.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env bash
echo "Generating GitHub pages site from markdown"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPT_DIR" || exit
if [ ! -d ./docs ]
then
echo " - creating docs directory"
mkdir ./docs
fi
if [ -d ./docs/figs ]
then
echo " - removing existing figs directory"
rm -rf ./docs/figs
fi
if [ -d ./docs/images ]
then
echo " - removing existing images directory"
rm -rf ./docs/images
fi
if [ -e ./docs/index.md ]
then
rm docs/index.md
fi
if [ -d ./docs/_data ]
then
echo " - removing existing menu data"
rm -rf ./docs/_data
fi
if [ -d ./docs/_includes ]
then
echo " - removing existing includes"
rm -rf ./docs/_includes
fi
if [ -d ./docs/_layouts ]
then
echo " - removing existing layouts"
rm -rf ./docs/_layouts
fi
if [ -d ./docs/img ]
then
echo " - removing existing images"
rm -rf ./docs/img
fi
if [ -d ./docs/css ]
then
echo " - removing existing css"
rm -rf ./docs/css
fi
if [ -d ./docs/release-notes ]
then
echo " - removing existing release notes"
rm -rf ./docs/release-notes
fi
mkdir ./docs/release-notes
cp -f ./RELEASENOTES.md ./docs/release-notes/index.md
bash "$SCRIPT_DIR/spec-publisher/utils/create-venv.sh"
command -v markdown-pp >/dev/null 2>&1 || {
tmpdir=$(dirname "$(mktemp -u)")
# shellcheck source=/tmp/.venv-markdown/bin/activate
source "$tmpdir/.venv-markdown/bin/activate"
}
echo " - MARKDOWN-PP: generating temp-site"
markdown-pp SITE_BASE.md -o /tmp/site.md
echo " - MARKDOWN-PP: generating site index.md"
markdown-pp SITE.md -o ./docs/index.md
rm /tmp/site.md
cp -Rf spec-publisher/site/* docs/
find ./docs/_* -type f -exec sed -i 's/CSIP/SIP/' {} \;
find ./docs/_* -type f -exec sed -i 's/csip/sip/' {} \;
cp -Rf specification/images docs/
cp -Rf spec-publisher/res/md/figs docs/
cp -Rf profile docs/
cp -Rf schema docs/
cp -Rf archive docs/
cp -Rf examples docs/