From 72e8ace28d921bb533a617c4b4078d0fb532fe98 Mon Sep 17 00:00:00 2001 From: joey Date: Thu, 23 Mar 2006 21:52:12 +0000 Subject: [PATCH] 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.) --- IkiWiki/Render.pm | 1 + doc/todo.mdwn | 1 - ikiwiki | 5 ++++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 1ac85be44..b3dfc364d 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -292,6 +292,7 @@ sub refresh () { #{{{ push @add, $file; $links{$page}=[]; $pagesources{$page}=$file; + $pagectime{$page}=time; } } my @del; diff --git a/doc/todo.mdwn b/doc/todo.mdwn index 1ab3e749a..4ae62867e 100644 --- a/doc/todo.mdwn +++ b/doc/todo.mdwn @@ -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 4c815dfa3..9001c5e2a 100755 --- 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}) { -- 2.44.0