aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaZderMind2014-11-09 23:47:50 +0100
committerMaZderMind2014-11-09 23:47:50 +0100
commit53a9bbf58a18b69a46115bd8e66a675313c68135 (patch)
treeb5dc14dfc6353e08c3b2f6692f1f7887553a3bd9
parent1ac82d89098b54cdbf3da66aac1b751cf46b56f0 (diff)
refine build step
-rw-r--r--.htaccess1
-rw-r--r--build.htaccess8
-rwxr-xr-xbuild.sh15
-rw-r--r--template/page.phtml3
4 files changed, 23 insertions, 4 deletions
diff --git a/.htaccess b/.htaccess
index cc6a5ae..636fcf7 100644
--- a/.htaccess
+++ b/.htaccess
@@ -33,4 +33,5 @@ RewriteRule ^(lounge|ambient)/?$ party.php?room=$1&format=audio [L]
# Show a known page in case of as miss
+RewriteRule ^404.html$ 404.php [L]
ErrorDocument 404 /~peter/voc-frontends/31c3/404.php
diff --git a/build.htaccess b/build.htaccess
new file mode 100644
index 0000000..e38f2bc
--- /dev/null
+++ b/build.htaccess
@@ -0,0 +1,8 @@
+DirectoryIndex index.html
+
+# Show a known page in case of as miss
+ErrorDocument 404 /404.html
+
+# Allow Caches & Proxies to Cache all resources
+ExpiresActive On
+ExpiresDefault "access plus 4 hours"
diff --git a/build.sh b/build.sh
index df06791..f85dffe 100755
--- a/build.sh
+++ b/build.sh
@@ -9,7 +9,6 @@ echo "spidering page"
mkdir -p build
wget \
--no-verbose \
- --no-clobber \
--no-host-directories \
--cut-dirs=3 \
--directory-prefix=build \
@@ -17,5 +16,15 @@ wget \
--recursive \
--no-parent \
--page-requisites \
- --convert-links \
- http://localhost/~peter/voc-frontends/31c3/
+ 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
diff --git a/template/page.phtml b/template/page.phtml
index 9d0cc0b..194ec81 100644
--- a/template/page.phtml
+++ b/template/page.phtml
@@ -15,6 +15,8 @@
<meta name="keywords" content="31C3, Hacking, Chaos Computer Club, Video, Media, Streaming, Hacker" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <base href="<?=h($baseurl)?>" />
+
<link href="assets/img/apple-touch-icon/76x76.png" rel="apple-touch-icon" />
<link href="assets/img/apple-touch-icon/76x76.png" rel="apple-touch-icon" sizes="76x76" />
<link href="assets/img/apple-touch-icon/72x72.png" rel="apple-touch-icon" sizes="72x72" />
@@ -27,7 +29,6 @@
<link href="assets/img/favicon/32x32.png" rel="icon" type="image/png" sizes="32x32" />
<link href="assets/img/favicon/16x16.png" rel="icon" type="image/png" sizes="16x16" />
- <base href="<?=h($baseurl)?>" />
<link type="text/css" rel="stylesheet" href="assets/css/lib/font-awesome.min.css" />
<link type="text/css" rel="stylesheet" href="assets/css/lib/mediaelementplayer.min.css" />
<link type="text/css" rel="stylesheet" href="assets/css/lustige-styles.css" />