]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Single dot in pagespec translates to 'current page'
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Fri, 20 Aug 2010 08:13:14 +0000 (10:13 +0200)
committerJoey Hess <joey@kitenet.net>
Mon, 30 Aug 2010 17:25:53 +0000 (13:25 -0400)
IkiWiki.pm
doc/ikiwiki/pagespec.mdwn

index df8abe2c2711281c220a604aa0ddca09ec915a02..6fd11296013eef2004dee6dd939c70230eaaf70c 100644 (file)
@@ -2401,6 +2401,9 @@ package IkiWiki::PageSpec;
 sub derel ($$) {
        my $path=shift;
        my $from=shift;
 sub derel ($$) {
        my $path=shift;
        my $from=shift;
+       if ($path eq '.') {
+               $path = $from;
+       }
 
        if ($path =~ m!^\./!) {
                $from=~s#/?[^/]+$## if defined $from;
 
        if ($path =~ m!^\./!) {
                $from=~s#/?[^/]+$## if defined $from;
index c66395f8441397764124e4fe693a17f18dc5767a..7fabff9a4bfdd80d6200291923cdfaba320f7ef6 100644 (file)
@@ -78,3 +78,7 @@ filenames of the pages in the wiki, so a pagespec "foo" used on page
 "a/b" will not match a page named "a/foo" or "a/b/foo". To match
 relative to the directory of the page containing the pagespec, you can
 use "./". For example, "./foo" on page "a/b" matches page "a/foo".
 "a/b" will not match a page named "a/foo" or "a/b/foo". To match
 relative to the directory of the page containing the pagespec, you can
 use "./". For example, "./foo" on page "a/b" matches page "a/foo".
+
+If you want to use the name of the page the pagespec is used in, you can use
+a single dot. For example, `link(.)` matches all the pages linking to the
+current page.