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