]> sipb.mit.edu Git - ikiwiki.git/blob - doc/ikiwiki/subpage/linkingrules.mdwn
Merge commit 'upstream/master' into prv/po
[ikiwiki.git] / doc / ikiwiki / subpage / linkingrules.mdwn
1 [[!meta robots="noindex, follow"]]
2 To link to or from a [[SubPage]], you can normally use a regular
3 [[WikiLink]] that does not contain the name of the parent directory of
4 the [[SubPage]]. Ikiwiki descends the directory hierarchy looking for a
5 page that matches your link.
6
7 For example, if FooBar/SubPage links to "OtherPage", ikiwiki will first 
8 prefer pointing the link to FooBar/SubPage/OtherPage if it exists, next
9 to FooBar/OtherPage and finally to OtherPage in the root of the wiki.
10
11 Note that this means that if a link on FooBar/SomePage to "OtherPage"
12 currently links to OtherPage, in the root of the wiki, and FooBar/OtherPage
13 is created, the link will _change_ to point to FooBar/OtherPage. On the
14 other hand, a link from BazBar to "OtherPage" would be unchanged by this
15 creation of a [[SubPage]] of FooBar.
16
17 You can also specify a link that contains a directory name, like
18 "FooBar/OtherPage" to more exactly specify what page to link to. This is
19 the only way to link to an unrelated [[SubPage]].
20
21 You can use this to, for example, to link from BazBar to "FooBar/SubPage",
22 or from BazBar/SubPage to "FooBar/SubPage".
23
24 You can also use "/" at the start of a link, to specify exactly which page
25 to link to, when there are multiple pages with similar names and the link
26 goes to the wrong page by default. For example, linking from
27 "FooBar/SubPage" to  "/OtherPage" will link to the "OtherPage" in the root
28 of the wiki, even if there is a "FooBar/OtherPage".
29
30 Also, if the wiki is configured with a userdir, you can link to pages
31 within the userdir without specifying a path to them. This is to allow for
32 easy linking to a user's page in the userdir, to sign a comment. These
33 links are checked for last of all.