-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·46 lines (34 loc) · 1.33 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
44
45
46
#!/usr/bin/env bash
set -e
modules=(achordion kaseta)
retailers=(beatsville schneidersladen synthesizergr thonk)
echo 'Rendering the index'
(
export MODULES=''
for module in ${modules[@]}; do
set -a; source "src/modules/${module}/frontpage-module.env"; set +a
export MODULES="${MODULES}$(envsubst < src/frontpage/module.html.tmpl)"
done
export RETAILERS=''
for retailer in ${retailers[@]}; do
set -a; source "src/retailers/retailer-${retailer}.env"; set +a
export RETAILERS="${RETAILERS}$(envsubst < src/frontpage/retailer.html.tmpl)"
done
export CONTENT="$(envsubst < src/frontpage/frontpage.html.tmpl)"
set -a; source src/frontpage/header.env; set +a
export HEADER="$(cat src/header.html.tmpl)"
export FOOTER="$(cat src/footer-long.html.tmpl)"
PAGE="$(envsubst < src/main.html.tmpl)"
echo "${PAGE}" > docs/index.html
)
for module in ${modules[@]}; do
echo "Rendering ${module} overview"
(
export CONTENT="$(cat src/modules/${module}/overview.html.tmpl)"
set -a; source "src/modules/${module}/overview.header.env"; set +a
export HEADER="$(cat src/header.html.tmpl)"
export FOOTER="$(cat src/footer-short.html.tmpl)"
PAGE="$(envsubst < src/main.html.tmpl)"
echo "${PAGE}" > "docs/${module}/index.html"
)
done