From c4d4cad3befbbd444d094cbeb0b6ebba3910a025 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 20 Aug 2010 10:13:14 +0200 Subject: [PATCH] Single dot in pagespec translates to 'current page' --- IkiWiki.pm | 3 +++ doc/ikiwiki/pagespec.mdwn | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/IkiWiki.pm b/IkiWiki.pm index df8abe2c2..6fd112960 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -2401,6 +2401,9 @@ package IkiWiki::PageSpec; sub derel ($$) { my $path=shift; my $from=shift; + if ($path eq '.') { + $path = $from; + } if ($path =~ m!^\./!) { $from=~s#/?[^/]+$## if defined $from; diff --git a/doc/ikiwiki/pagespec.mdwn b/doc/ikiwiki/pagespec.mdwn index c66395f84..7fabff9a4 100644 --- a/doc/ikiwiki/pagespec.mdwn +++ b/doc/ikiwiki/pagespec.mdwn @@ -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". + +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. -- 2.26.2