From 53a9bbf58a18b69a46115bd8e66a675313c68135 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 9 Nov 2014 23:47:50 +0100 Subject: refine build step --- .htaccess | 1 + build.htaccess | 8 ++++++++ build.sh | 15 ++++++++++++--- template/page.phtml | 3 ++- 4 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 build.htaccess 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 -tag" +find build -name "*.html" -print0 | xargs -0 -exec sed -i 's~~~g'; + +echo "inserting hidden compiletime marker" +find build -name "*.html" -print0 | xargs -0 -exec sed -i "s~~\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 @@ + + @@ -27,7 +29,6 @@ - -- cgit v1.2.3