streaming-website/build.sh

36 lines
870 B
Bash
Raw Normal View History

2014-10-18 11:35:04 +00:00
#!/bin/sh
2015-03-08 14:46:33 +00:00
LOCAL_SERVER='http://localhost/streaming-website'
2015-03-08 14:46:33 +00:00
echo "building less"
rm -f assets/css/main.css
lessc assets/css/main.less assets/css/main.css
2014-10-18 11:35:04 +00:00
2014-11-09 20:26:55 +00:00
echo "removing old build"
rm -rf build
echo "spidering page"
mkdir -p build
wget \
--no-verbose \
--no-host-directories \
2015-03-08 14:46:33 +00:00
--cut-dirs=1 \
2014-11-09 20:26:55 +00:00
--directory-prefix=build \
--user-agent=StaticBuildScript \
--recursive \
--no-parent \
--page-requisites \
2014-11-10 22:12:47 +00:00
$LOCAL_SERVER/ \
$LOCAL_SERVER/404.html \
$LOCAL_SERVER/program.json
2014-11-09 22:47:50 +00:00
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