updates from src
[ikiwiki] / doc / 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".