Add file cretion times to the index file.
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 23 Mar 2006 21:52:12 +0000 (21:52 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 23 Mar 2006 21:52:12 +0000 (21:52 +0000)
(Note that it's not really the file creation time, just the first time
ikiwiki saw it.)

IkiWiki/Render.pm
doc/todo.mdwn
ikiwiki

index 1ac85be44dad722e1588000fde059d420a433659..b3dfc364d12805e5bc3e24005fff2d5c4197588d 100644 (file)
@@ -292,6 +292,7 @@ sub refresh () { #{{{
                        push @add, $file;
                        $links{$page}=[];
                        $pagesources{$page}=$file;
+                       $pagectime{$page}=time;
                }
        }
        my @del;
index 1ab3e749a543aa923e680c984bc81ad091bc3497..4ae62867ec01d1755891e272e0a9a08e31af74ec 100644 (file)
@@ -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:
diff --git a/ikiwiki b/ikiwiki
index 4c815dfa3ca0013a2d59866f48d8b86d72e49295..9001c5e2a424b7653a1e9ae0478c83320be16f34 100755 (executable)
--- a/ikiwiki
+++ b/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}) {