X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/73ae87a4d475e4702e7135adef0a5be4b0c54279..c0c1e05daba09ce9c73c6c2f1ceca02b488613ba:/IkiWiki/Render.pm?ds=sidebyside diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 59cec3646..5cb67ea07 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -24,13 +24,19 @@ sub calculate_backlinks () { $backlinks_calculated=1; } -sub backlinks ($) { +sub backlink_pages ($) { my $page=shift; calculate_backlinks(); + return keys %{$backlinks{$page}}; +} + +sub backlinks ($) { + my $page=shift; + my @links; - foreach my $p (keys %{$backlinks{$page}}) { + foreach my $p (backlink_pages($page)) { my $href=urlto($p, $page); # Trim common dir prefixes from both pages. @@ -412,7 +418,7 @@ sub refresh () { } calculate_backlinks(); foreach my $file (@needsbuild) { - debug(sprintf(gettext("rendering %s"), $file)); + debug(sprintf(gettext("building %s"), $file)); render($file); $rendered{$file}=1; } @@ -433,7 +439,7 @@ sub refresh () { foreach my $page (keys %{$backlinks{$p}}) { my $file=$pagesources{$page}; next if $rendered{$file}; - debug(sprintf(gettext("rendering %s, which links to %s"), $file, $p)); + debug(sprintf(gettext("building %s, which links to %s"), $file, $p)); render($file); $rendered{$file}=1; } @@ -454,7 +460,7 @@ sub refresh () { next if $f eq $file; my $page=pagename($file); if (pagespec_match($page, $depends{$p}, location => $p)) { - debug(sprintf(gettext("rendering %s, which depends on %s"), $f, $page)); + debug(sprintf(gettext("building %s, which depends on %s"), $f, $page)); render($f); $rendered{$f}=1; last; @@ -493,7 +499,7 @@ sub refresh () { my $linkfile=$pagesources{$link}; if (defined $linkfile) { next if $rendered{$linkfile}; - debug(sprintf(gettext("rendering %s, to update its backlinks"), $linkfile)); + debug(sprintf(gettext("building %s, to update its backlinks"), $linkfile)); render($linkfile); $rendered{$linkfile}=1; } @@ -505,7 +511,7 @@ sub refresh () { my $page=pagename($src); foreach my $file (@{$oldrenderedfiles{$page}}) { if (! grep { $_ eq $file } @{$renderedfiles{$page}}) { - debug(sprintf(gettext("removing %s, no longer rendered by %s"), $file, $page)); + debug(sprintf(gettext("removing %s, no longer built by %s"), $file, $page)); prune($config{destdir}."/".$file); } } @@ -529,7 +535,7 @@ sub commandline_render () { $file=~s/\Q$config{srcdir}\E\/?//; my $type=pagetype($file); - die sprintf(gettext("ikiwiki: cannot render %s"), $srcfile)."\n" unless defined $type; + die sprintf(gettext("ikiwiki: cannot build %s"), $srcfile)."\n" unless defined $type; my $content=readfile($srcfile); my $page=pagename($file); $pagesources{$page}=$file;