]> sipb.mit.edu Git - ikiwiki.git/commitdiff
IkiWiki::Render: make 'scan' idempotent
authorSimon McVittie <smcv@debian.org>
Fri, 13 Sep 2013 08:14:24 +0000 (09:14 +0100)
committerSimon McVittie <smcv@debian.org>
Wed, 5 Mar 2014 10:42:19 +0000 (10:42 +0000)
If it does nothing when a page has already been scanned, we can use it
at any time to force a page to be scanned. In particular, the
templatebody plugin is going to need this.

IkiWiki/Render.pm

index fa2940b01ce23e5f988f9c9176c4a775c2171e53..9e93534c6aca921e89fb86d2df9190cba3c403ba 100644 (file)
@@ -6,7 +6,7 @@ use warnings;
 use strict;
 use IkiWiki;
 
 use strict;
 use IkiWiki;
 
-my (%backlinks, %rendered);
+my (%backlinks, %rendered, %scanned);
 our %brokenlinks;
 my $links_calculated=0;
 
 our %brokenlinks;
 my $links_calculated=0;
 
@@ -154,6 +154,8 @@ sub genpage ($$) {
 
 sub scan ($) {
        my $file=shift;
 
 sub scan ($) {
        my $file=shift;
+       return if $scanned{$file};
+       $scanned{$file}=1;
 
        debug(sprintf(gettext("scanning %s"), $file));
 
 
        debug(sprintf(gettext("scanning %s"), $file));