From ff6941cef9a88ea2a0d3af2e5ae1edd09048916b Mon Sep 17 00:00:00 2001 From: joey Date: Thu, 21 Dec 2006 20:11:18 +0000 Subject: * Add support for links of the form [../foo]], this links to the page foo a level higher in the directory hierarchy than the one it would link to by default. --- IkiWiki.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'IkiWiki.pm') diff --git a/IkiWiki.pm b/IkiWiki.pm index f76e9fe30..499d3a71f 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -298,6 +298,12 @@ sub bestlink ($$) { #{{{ my $link=shift; my $cwd=$page; + + # relative links + while ($link=~s!(^|/)\.\./!!g) { + $cwd=~s!/?[^/]+$!!; + } + do { my $l=$cwd; $l.="/" if length $l; -- cgit v1.2.3