-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·47 lines (39 loc) · 1.46 KB
/
build.sh
File metadata and controls
executable file
·47 lines (39 loc) · 1.46 KB
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
#!/bin/bash
rm -rf ./_site
mkdir -p ./_site
cp ./src/robots.txt ./_site/.
cp ./src/CNAME ./_site/.
# Assets
cp -r ./assets ./_site/.
cp -r ./src/vintage ./_site/vintage
for file in ./_site/assets/styles/*.css; do
dest=${file%.css}.min.css
esbuild --minify $file >$dest &
done
get_checksum() {
file=$1
sha256sum $file | cut -d ' ' -f1
}
input='debug=true'
set_checksum() {
name=$1
file=$2
printf "%s,checksums.%s=%s" $input $1 "$(get_checksum $2)"
}
input=$(set_checksum "style_reset" ./_site/assets/styles/01_reset.min.css)
input=$(set_checksum "style_fonts" ./_site/assets/styles/02_fonts.min.css)
input=$(set_checksum "style_utils" ./_site/assets/styles/03_utils.min.css)
input=$(set_checksum "style_main" ./_site/assets/styles/50_main.min.css)
input=$(set_checksum "style_shared" ./_site/assets/styles/51_shared.min.css)
input=$(set_checksum "style_responsive" ./_site/assets/styles/99_responsive.min.css)
input=$(set_checksum "script_index" ./_site/assets/scripts/index.js)
# Pages
mend --input "$input" ./src/index.html >./_site/index.html &
mend --input "$input" ./src/artwork.html >./_site/artwork.html &
mend --input "$input" ./src/minecraft_unicode.html >./_site/minecraft_unicode.html &
mend --input "$input" ./src/eyecons.html >./_site/eyecons.html &
mend --input "$input" ./src/tomefile.html >./_site/tomefile.html &
mend --input "$input" ./src/crowscout_ii.html >./_site/crowscout_ii.html &
mend --input "$input" ./src/blog.html >./_site/blog.html &
wait
echo "Done."