ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/www/generate
(Generate patch)

Comparing deliantra/www/generate (file contents):
Revision 1.15 by pippijn, Sun Sep 16 15:24:40 2007 UTC vs.
Revision 1.16 by pippijn, Tue Sep 18 20:25:34 2007 UTC

72 72
73 for my $file (@list) { 73 for my $file (@list) {
74 my @contents = do { open my $fh, "<$file" or die "$file: $!\n"; <$fh> }; 74 my @contents = do { open my $fh, "<$file" or die "$file: $!\n"; <$fh> };
75 my $subtitle = shift @contents; 75 my $subtitle = shift @contents;
76 chomp $subtitle; 76 chomp $subtitle;
77
78 my $curfile = $file;
79 $curfile =~ s/$indir\/(.+\.html)$/$1/;
77 80
78 my $tt = new Template { 81 my $tt = new Template {
79 INTERPOLATE => 1, 82 INTERPOLATE => 1,
80 POST_CHOMP => 1, 83 POST_CHOMP => 1,
81 EVAL_PERL => 1, 84 EVAL_PERL => 1,
90 93
91 # Re-initialised with static variables from YAML 94 # Re-initialised with static variables from YAML
92 $vars = $static; 95 $vars = $static;
93 $vars->{subtitle} = $subtitle; 96 $vars->{subtitle} = $subtitle;
94 $vars->{contents} = $data; 97 $vars->{contents} = $data;
98 $vars->{curfile} = $curfile;
95 99
96 my $output = ''; # Variable to store the complete page 100 my $output = ''; # Variable to store the complete page
97 $tt->process ('template.html', $vars, \$output) 101 $tt->process ('template.html', $vars, \$output)
98 or die $tt->error; 102 or die $tt->error;
99 103
122 126
123use strict; 127use strict;
124use warnings; 128use warnings;
125use utf8; 129use utf8;
126 130
127my $rcsid = '$Id: generate,v 1.15 2007/09/16 15:24:40 pippijn Exp $'; 131my $rcsid = '$Id: generate,v 1.16 2007/09/18 20:25:34 pippijn Exp $';
128 132
129use base "Pod::POM::View"; 133use base "Pod::POM::View";
130 134
131our $subdir; 135our $subdir;
132our $dir; 136our $dir;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines