* Need to keep track of creation dates of pages in the index file.
* Need to keep track of the globlists in the index file.
- - Probably need to redesign the index file format to allow for this sort
- of future expansion.
* Need to pick a good token and note that the token will need to be passed
multiple parameters. Possibly something like this:
- [[embed pages="myblog/*" show="30"]]
+ [[inline pages="myblog/*" show="30"]]
## revisit case
while (<IN>) {
$_=possibly_foolish_untaint($_);
chomp;
- my ($mtime, $file, $rendered, @links)=split(' ', $_);
- my $page=pagename($file);
- $pagesources{$page}=$file;
- $oldpagemtime{$page}=$mtime;
- $oldlinks{$page}=[@links];
- $links{$page}=[@links];
- $renderedfiles{$page}=$rendered;
+ my %items;
+ $items{link}=[];
+ foreach my $i (split(/ /, $_)) {
+ my ($item, $val)=split(/=/, $i, 2);
+ push @{$items{$item}}, $val;
+ }
+
+ my $page=pagename($items{src}[0]);
+ $pagesources{$page}=$items{src}[0];
+ $oldpagemtime{$page}=$items{mtime}[0];
+ $oldlinks{$page}=[@{$items{link}}];
+ $links{$page}=[@{$items{link}}];
+ $renderedfiles{$page}=$items{dest}[0];
}
close IN;
} #}}}
open (OUT, ">$config{wikistatedir}/index") ||
error("cannot write to $config{wikistatedir}/index: $!");
foreach my $page (keys %oldpagemtime) {
- print OUT "$oldpagemtime{$page} $pagesources{$page} $renderedfiles{$page} ".
- join(" ", @{$links{$page}})."\n"
- if $oldpagemtime{$page};
+ my $line="mtime=$oldpagemtime{$page} ".
+ "src=$pagesources{$page} ".
+ "dest=$renderedfiles{$page}";
+ if ($oldpagemtime{$page}) {
+ $line.=" link=$_" foreach @{$links{$page}};
+ }
+ print OUT $line."\n";
}
close OUT;
} #}}}