]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/listdirectives_doesn__39__t_register_a_link.mdwn
git: explicitly specify the branch to push to origin
[ikiwiki.git] / doc / bugs / listdirectives_doesn__39__t_register_a_link.mdwn
1 The [[ikiwiki/directive/listdirectives]]` directive doesn't register a link between the page and the subpages. This is a problem because then the [[ikiwiki/directive/orphans]] directive then marks the directives as orphans... Maybe it is a but with the orphans directive however... A simple workaround is to exclude those files from the orphans call... --[[anarcat]]
2
3 > There's a distinction between wikilinks (matched by `link()`,
4 > `backlink()` etc.) and other constructs that produce a
5 > hyperlink. Some directives count as a wikilink (like `tag`)
6 > but many don't (notably `inline`, `map`, `listdirectives`,
7 > and `orphans` itself). As documented in
8 > [[ikiwiki/directive/orphans]], orphans will tend to list
9 > pages that are only matched by inlines/maps, too.
10 >
11 > The rule of thumb seems to be that a link to a particular
12 > page counts as a wikilink, but a directive that lists
13 > pages matching some pattern does not; so I think
14 > `listdirectives` is working as intended here.
15 > `orphans` itself obviously shouldn't count as a wikilink,
16 > because that would defeat the point of it :-)
17 >
18 > Anything that uses a [[ikiwiki/pagespec]] to generate links,
19 > like `inline` and `map`, can't generate wikilinks, because
20 > wikilinks are gathered during the scan phase, and pagespecs
21 > can't be matched until after the scan phase has finished
22 > (otherwise, it'd be non-deterministic whether all wikilinks
23 > had been seen yet, and `link()` in pagespecs wouldn't work
24 > predictably).
25 >
26 > I suggest just using something like:
27 >
28 >     \[[!orphans pages="* and !blog/* and !ikiwiki/directive/*"]]
29 >
30 > This wiki's example of listing [[plugins/orphans]] has a
31 > more elaborate pagespec, which avoids bugs, todo items etc.
32 > as well.
33 >
34 > --[[smcv]]
35
36 > No follow-up or objection for a while, so considering this to
37 > be [[working as designed|done]]. --[[smcv]]