-
Notifications
You must be signed in to change notification settings - Fork 0
/
static.sh
executable file
·46 lines (40 loc) · 1.52 KB
/
static.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
#!/bin/bash
CUT_START='29'
CUT_END='30'
declare -a simple_pages=(
[0]='index Home homemain'
[1]='nlp NLP nlpmain'
)
declare -a content_pages=(
[0]='processing Processing realm'
[1]='language Language realm'
[2]='natural Natural realm'
[3]='kumia Kumia kumia'
[4]='london London singlepost'
[5]='privacy Privacy singlepost'
[6]='new_york NewYork singlepost'
[7]='spiritual-tech SpiritualTech spiritualtech'
[8]='spiritual Spiritual singlepost'
[9]='financial Financial financial'
)
for page in "${simple_pages[@]}"
do
read -ra page_parts <<< "$page"
# Build page
cp static/src/offline/template.html static/src/offline/${page_parts[0]}
sed -i "s/TITLE_PLACEHOLDER/Kamutiv Tech | ${page_parts[1]}/g" static/src/offline/${page_parts[0]}
sed -i "s/MAIN_CONTENT_PLACEHOLDER/${page_parts[2]}/g" static/src/offline/${page_parts[0]}
echo "Done with...${page_parts[0]}"
done
for page in "${content_pages[@]}"
do
read -ra page_parts <<< "$page"
# Export page
cp static/src/offline/template.html static/src/offline/temp
sed -i "s/TITLE_PLACEHOLDER/Kamutiv Tech | ${page_parts[1]}/g" static/src/offline/temp
sed -i "s/MAIN_CONTENT_PLACEHOLDER/${page_parts[2]}/g" static/src/offline/temp
docker run --rm -v `pwd`:/app nlp-web:debug bash -c "python3 src/utilities/tojson.py ${page_parts[0]} > testtest"
cat <(sed -n "1,${CUT_START}p" static/src/offline/temp) testtest <(sed -n "${CUT_END},1000p" static/src/offline/temp) > static/src/offline/${page_parts[0]}
rm -rf testtest static/src/offline/temp
echo "Done with...${page_parts[0]}"
done