3 1. Add the backlinkbug plugin below to ikiwiki.
4 2. Create a page named test.mdwn somewhere in the wiki.
5 3. Refresh ikiwiki in verbose mode. Pages whose bestlink is the test.mwdn page will be printed to the terminal.
7 5. Refresh ikiwiki in verbose mode again. The same pages will be printed to the terminal again.
8 6. Refresh ikiwiki in verbose mode another time. Now no pages will be printed.
10 bestlink() checks %links (and %pagecase) to confirm the existance of the page.
11 However, find_del_files() does not remove the deleted page from %links (and %pagecase).
13 Since find_del_files removes the deleted page from %pagesources and %destsources,
14 won't it make sense for bestlink() to check %pagesources first? --[[harishcm]]
20 # Plugin to reproduce bestlink returning deleted pages.
21 # Run with ikiwiki in verbose mode.
23 package IkiWiki::Plugin::bestlinkbug;
30 hook(type => "getsetup", id => "bestlinkbug", call => \&getsetup);
31 hook(type => "needsbuild", id => "bestlinkbug", call => \&needsbuild);
45 foreach my $page (keys %pagestate) {
46 my $testpage=bestlink($page, "test") || next;