diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-03-21 14:42:59 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-03-21 14:42:59 -0400 |
commit | 5d9ed614db889116421be0f24edc14b198c1e18d (patch) | |
tree | c955f761ac851c023fa3ebd69235c59b36c9e483 | |
parent | e3866fd94f31a656dddd78dd3f8750628264e9d3 (diff) |
fix page source storing
This saves space, and stores the data under the right keys.
-rw-r--r-- | IkiWiki.pm | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index 2fad45c38..684713821 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -914,12 +914,13 @@ sub loadindex () { #{{{ return 0; } my %index=%$ret; - foreach my $page (keys %index) { - my %d=%{$index{$page}}; + foreach my $src (keys %index) { + my %d=%{$index{$src}}; + my $page=pagename($src); $pagectime{$page}=$d{ctime}; if (! $config{rebuild}) { + $pagesources{$page}=$src; $pagemtime{$page}=$d{mtime}; - $pagesources{$page}=$d{src}; $renderedfiles{$page}=$d{dest}; if (exists $d{links} && ref $d{links}) { $links{$page}=$d{links}; @@ -961,23 +962,23 @@ sub saveindex () { #{{{ my %index; foreach my $page (keys %pagemtime) { next unless $pagemtime{$page}; + my $src=$pagesources{$page}; - $index{$page}={ + $index{$src}={ ctime => $pagectime{$page}, mtime => $pagemtime{$page}, - src => $pagesources{$page}, dest => $renderedfiles{$page}, links => $links{$page}, }; if (exists $depends{$page}) { - $index{$page}{depends} = $depends{$page}; + $index{$src}{depends} = $depends{$page}; } if (exists $pagestate{$page}) { foreach my $id (@hookids) { foreach my $key (keys %{$pagestate{$page}{$id}}) { - $index{$page}{state}{$id}{$key}=$pagestate{$page}{$id}{$key}; + $index{$src}{state}{$id}{$key}=$pagestate{$page}{$id}{$key}; } } } |