… | |
… | |
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 | |
123 | use strict; |
127 | use strict; |
124 | use warnings; |
128 | use warnings; |
125 | use utf8; |
129 | use utf8; |
126 | |
130 | |
127 | my $rcsid = '$Id: generate,v 1.15 2007/09/16 15:24:40 pippijn Exp $'; |
131 | my $rcsid = '$Id: generate,v 1.16 2007/09/18 20:25:34 pippijn Exp $'; |
128 | |
132 | |
129 | use base "Pod::POM::View"; |
133 | use base "Pod::POM::View"; |
130 | |
134 | |
131 | our $subdir; |
135 | our $subdir; |
132 | our $dir; |
136 | our $dir; |