aboutsummaryrefslogtreecommitdiff
path: root/build.sh
blob: f85dffe5eb2d379f8b1a762230cf3eecdf9ccfd7 (plain)
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
#!/bin/sh
echo "building scss"
scss assets/css/src/lustige-styles.scss assets/css/lustige-styles.css

echo "removing old build"
rm -rf build

echo "spidering page"
mkdir -p build
wget \
	--no-verbose \
	--no-host-directories \
	--cut-dirs=3 \
	--directory-prefix=build \
	--user-agent=StaticBuildScript \
	--recursive \
	--no-parent \
	--page-requisites \
	http://localhost/~peter/voc-frontends/31c3/ \
	http://localhost/~peter/voc-frontends/31c3/404.html

echo "setting <base />-tag"
find build -name "*.html" -print0 | xargs -0 -exec sed -i 's~<base href="[^"]*" />~<base href="/" />~g';

echo "inserting hidden compiletime marker"
find build -name "*.html" -print0 | xargs -0 -exec sed -i "s~<!DOCTYPE html>~<!DOCTYPE html>\n<!-- static published at `date` on `uname -n` -->~g";


echo "copying .htaccess"
cp build.htaccess build/.htaccess