Single dot in pagespec translates to 'current page'

master
Giuseppe Bilotta 2010-08-20 10:13:14 +02:00 committed by Joey Hess
parent 1e7a53c70b
commit c4d4cad3be
2 changed files with 7 additions and 0 deletions

View File

@ -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;

View 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".
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.