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:
16 >> [[applied|done]] thanks --[[Joey]]
18 From 30512ac5f6a724bafb1095ab246e0648999f7b6c Mon Sep 17 00:00:00 2001
19 From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
20 Date: Fri, 13 Jan 2012 11:02:11 +0100
21 Subject: [PATCH] backlink(.) should behave like backlink(<current page>)
23 Since commit c4d4cad3befbbd444d094cbeb0b6ebba3910a025, the single dot in
24 a pagespec can be used to mean the current page. While this worked
25 correctly in link() it didn't work in backlink(). Fix this by explicitly
26 checking the testpage in backlink against . and replacing it with the
27 current location if necessary.
29 IkiWiki.pm | 10 ++++++++--
30 1 files changed, 8 insertions(+), 2 deletions(-)
32 diff --git a/IkiWiki.pm b/IkiWiki.pm
33 index 08e242a..bc56501 100644
36 @@ -2647,8 +2647,14 @@ sub match_link ($$;@) {
39 sub match_backlink ($$;@) {
40 - my $ret=match_link($_[1], $_[0], @_);
41 - $ret->influences($_[1] => $IkiWiki::DEPEND_LINKS);
45 + if ($testpage eq '.') {
46 + $testpage = $params{'location'}
48 + my $ret=match_link($testpage, $page, @_);
49 + $ret->influences($testpage => $IkiWiki::DEPEND_LINKS);
57 > (you need to re-make IkiWiki for it to work)