1 It seems `backlink(.)` doesn't work, that is, it doesn't match pages linked
2 to from the current page.
4 If I have two test pages, `foo`, which links to `bar`, then (on the `foo`
7 * backlink(foo) lists 'bar'
8 * backlink(.) lists nothing
10 tested with 3.20120109.
14 > The attached patch should fix it:
17 From 30512ac5f6a724bafb1095ab246e0648999f7b6c Mon Sep 17 00:00:00 2001
18 From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
19 Date: Fri, 13 Jan 2012 11:02:11 +0100
20 Subject: [PATCH] backlink(.) should behave like backlink(<current page>)
22 Since commit c4d4cad3befbbd444d094cbeb0b6ebba3910a025, the single dot in
23 a pagespec can be used to mean the current page. While this worked
24 correctly in link() it didn't work in backlink(). Fix this by explicitly
25 checking the testpage in backlink against . and replacing it with the
26 current location if necessary.
28 IkiWiki.pm | 10 ++++++++--
29 1 files changed, 8 insertions(+), 2 deletions(-)
31 diff --git a/IkiWiki.pm b/IkiWiki.pm
32 index 08e242a..bc56501 100644
35 @@ -2647,8 +2647,14 @@ sub match_link ($$;@) {
38 sub match_backlink ($$;@) {
39 - my $ret=match_link($_[1], $_[0], @_);
40 - $ret->influences($_[1] => $IkiWiki::DEPEND_LINKS);
44 + if ($testpage eq '.') {
45 + $testpage = $params{'location'}
47 + my $ret=match_link($testpage, $page, @_);
48 + $ret->influences($testpage => $IkiWiki::DEPEND_LINKS);
56 > (you need to re-make IkiWiki for it to work)