Change template directory layout (static instead of public)
authorHeiko Schlittermann <hs@schlittermann.de>
Mon, 04 Jan 2016 11:18:27 +0100
changeset 77 3ee9d9b5724c
parent 76 cc818568a7ec
child 78 06e0bf90ffec
Change template directory layout (static instead of public)
bin/once
configs/apache.conf
templates/once.tt
--- a/bin/once	Thu Dec 31 19:01:39 2015 +0100
+++ b/bin/once	Mon Jan 04 11:18:27 2016 +0100
@@ -69,9 +69,9 @@
 
 my %TT_CONFIG = (
   INCLUDE_PATH =>
-      [ (map { catfile($Bin, $_) } qw(templates templates.default templates.var) ),
+      [ (map { catfile($Bin, $_) } qw(templates templates.default) ),
 	#(map { catfile(dist_dir($DIST), $_) } qw(var templates.override templates)),
-	(map { catfile($RealBin, $_) } qw(templates.var templates)),
+	(map { catfile($RealBin, $_) } qw(templates)),
       ]
 );
 
--- a/configs/apache.conf	Thu Dec 31 19:01:39 2015 +0100
+++ b/configs/apache.conf	Mon Jan 04 11:18:27 2016 +0100
@@ -10,26 +10,26 @@
     # This directory needs to be r/w by the web server user 
     # (wwwrun, www-data, who ever), but it must not be
     # accessible via HTTP(s)
-    <Directory $var>
+    <Directory "$var">
 	Require all denied
     </Directory>
 
     Action	once-handler	    /once-handler/once.cgi virtual
     ScriptAlias /once-handler/	    $lib/
-    Alias	$location/public    $lib/public
+    Alias	$location/static    $lib/static
 
     # Order of location blocks matters!
     # We handle requests to our script, with the exception (see below)
-    # for …/public/… requests. These should be answered from a simple
+    # for …/static/… requests. These should be answered from a simple
     # static directory for style sheets and similiar
     <Location "$location">
 	    SetHandler once-handler
     </Location>
-    <Location "$location/public">
+    <Location "$location/static">
 	    SetHandler none
     </Location>
 
-    <Directory "$lib/public">
+    <Directory "$lib/static">
 	Require all granted
 	Allow from all
     </Directory>
--- a/templates/once.tt	Thu Dec 31 19:01:39 2015 +0100
+++ b/templates/once.tt	Mon Jan 04 11:18:27 2016 +0100
@@ -11,10 +11,12 @@
 <style type="text/css">
     th { text-align: left; }
 </style>
-<link rel="stylesheet" href="once/public/once.css">
+<link rel="stylesheet" href="once/static/once.css">
 </head>
 <body>
+
 [% content %]
+
 <hr />
 <div align="right">
     <font size=1>[% vcs.version %] | Scripting: Matthias Förste, Heiko Schlittermann</font>