M index.pl => index.pl +7 -10
@@ 4,7 4,7 @@
# http://woffs.de/WCM
# <wcm@woffs.de>
#
-# Version 20110503
+# Version 20110505
#
# © WofFS 2010
# License: CC-BY-SA 3.0
@@ 151,6 151,7 @@ if (my $ru=$ENV{REQUEST_URI}) {
} else {
$abs.=$ENV{'SCRIPT_NAME'} || '/index.pl';
}
+(my $prefix=$abs)=~s,[^/]*$,,;
$abs.='?page=' if $abs =~ /index\.pl$/;
$abs.='page=' if $abs =~ /index\.pl\?$/;
@@ 178,15 179,11 @@ if ($redir) {
open T,"< $template" or die $!;
while (<T>) {
- if (/__navi__/) {
- print "$navi\n";
- } elsif (/__title__/) {
- print "$pagetitle\n";
- } elsif (/__content__/) {
- print "$content\n";
- } else {
- print;
- }
+ s/__navi__/$navi/g;
+ s/__title__/$pagetitle/g;
+ s/__content__/$content/g;
+ s/__prefix__/$prefix/g;
+ print;
}
close T;
}
M template.html => template.html +1 -1
@@ 4,7 4,7 @@
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<meta http-equiv='Content-Style-Type' content='text/css' />
- <link rel='stylesheet' type='text/css' href='template.css' />
+ <link rel='stylesheet' type='text/css' href='__prefix__template.css' />
<title>
WCM
__title__