Add file cretion times to the index file.
(Note that it's not really the file creation time, just the first time ikiwiki saw it.)master
parent
ca0be85c59
commit
72e8ace28d
|
@ -292,6 +292,7 @@ sub refresh () { #{{{
|
|||
push @add, $file;
|
||||
$links{$page}=[];
|
||||
$pagesources{$page}=$file;
|
||||
$pagectime{$page}=time;
|
||||
}
|
||||
}
|
||||
my @del;
|
||||
|
|
|
@ -88,7 +88,6 @@ Note that this allows for weblogs with different sections, etc.
|
|||
|
||||
Requirements:
|
||||
|
||||
* Need to keep track of creation dates of pages in the index file.
|
||||
* Need to keep track of the globlists in the index file.
|
||||
* Need to pick a good token and note that the token will need to be passed
|
||||
multiple parameters. Possibly something like this:
|
||||
|
|
5
ikiwiki
5
ikiwiki
|
@ -8,7 +8,8 @@ use File::Spec;
|
|||
use HTML::Template;
|
||||
use lib '.'; # For use without installation, removed by Makefile.
|
||||
|
||||
use vars qw{%config %links %oldlinks %oldpagemtime %renderedfiles %pagesources};
|
||||
use vars qw{%config %links %oldlinks %oldpagemtime %pagectime
|
||||
%renderedfiles %pagesources};
|
||||
|
||||
sub usage () { #{{{
|
||||
die "usage: ikiwiki [options] source dest\n";
|
||||
|
@ -326,6 +327,7 @@ sub loadindex () { #{{{
|
|||
my $page=pagename($items{src}[0]);
|
||||
$pagesources{$page}=$items{src}[0];
|
||||
$oldpagemtime{$page}=$items{mtime}[0];
|
||||
$pagectime{$page}=$items{ctime}[0];
|
||||
$oldlinks{$page}=[@{$items{link}}];
|
||||
$links{$page}=[@{$items{link}}];
|
||||
$renderedfiles{$page}=$items{dest}[0];
|
||||
|
@ -341,6 +343,7 @@ sub saveindex () { #{{{
|
|||
error("cannot write to $config{wikistatedir}/index: $!");
|
||||
foreach my $page (keys %oldpagemtime) {
|
||||
my $line="mtime=$oldpagemtime{$page} ".
|
||||
"ctime=$pagectime{$page} ".
|
||||
"src=$pagesources{$page} ".
|
||||
"dest=$renderedfiles{$page}";
|
||||
if ($oldpagemtime{$page}) {
|
||||
|
|
Loading…
Reference in New Issue