]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/ikiwiki/directive/inline.mdwn
Merge remote-tracking branch 'smcv/ready/limit'
[git.ikiwiki.info.git] / doc / ikiwiki / directive / inline.mdwn
1 The `inline` directive is supplied by the [[!iki plugins/inline desc=inline]] plugin.
3 This is a directive that allows including one wiki page inside another.
4 The most common use of inlining is generating blogs and RSS or Atom feeds.
6 Example:
8         \[[!inline pages="blog/* and !*/Discussion" limit="10" rootpage="blog"]]
10 Any pages that match the specified [[PageSpec]] (in the example, any
11 [[SubPage]] of "blog") will be part of the blog, and the newest 10
12 of them will appear in the page. Note that if files that are not pages
13 match the [[PageSpec]], they will be included in the feed using RSS
14 enclosures, which is useful for simple [[!iki podcast desc=podcasting]];
15 for fuller-featured podcast feeds, enclose media files in blog posts
16 using [[meta]].
18 The optional `rootpage` parameter tells the wiki that new posts to this
19 blog should default to being [[SubPages|SubPage]] of "blog", and enables a
20 form at the top of the blog that can be used to add new items.
22 If you want your blog to have an archive page listing every post ever made
23 to it, you can accomplish that like this:
25         \[[!inline pages="blog/* and !*/Discussion" archive="yes"]]
27 You can even create an automatically generated list of all the pages on the
28 wiki, with the most recently added at the top, like this:
30         \[[!inline pages="* and !*/Discussion" archive="yes"]]
32 If you want to be able to add pages to a given blog feed by tagging them,
33 you can do that too. To tag a page, just make it link to a page or pages 
34 that represent its tags. Then use the special `link()` [[PageSpec]] to match
35 all pages that have a given tag:
37         \[[!inline pages="link(life)"]]
39 Or include some tags and exclude others:
41         \[[!inline pages="link(debian) and !link(social)"]]
43 ## usage
45 There are many parameters you can use with the `inline`
46 directive. These are the commonly used ones:
48 * `pages` - A [[PageSpec]] of the pages to inline.
49 * `limit` - Specify the maximum number of matching pages to inline.
50   Default is 10, unless archiving, when the default is to show all.
51   Set to 0 to show all matching pages.
52   In older versions of IkiWiki this parameter was called `show`, which
53   also still works.
54 * `archive` - If set to "yes", only list page titles and some metadata, not
55   full contents.
56 * `title` - Sets the title of the rss feed if one is generated.
57   Defaults to the name of the page.
58 * `description` - Sets the description of the rss feed if one is generated.
59   Defaults to the name of the wiki.
60 * `skip` - Specify a number of pages to skip displaying. Can be useful
61   to produce a feed that only shows archived pages.
62 * `postform` - Set to "yes" to enable a form to post new pages to a
63   blog.
64 * `postformtext` - Set to specify text that is displayed in a postform.
65 * `rootpage` - Enables the postform, and allows controling where
66   newly posted pages should go, by specifiying the page that
67   they should be a [[SubPage]] of.
69 Here are some less often needed parameters:
71 * `actions` - If set to "yes" add links to the bottom of the inlined pages 
72   for editing and discussion (if they would be shown at the top of the page
73   itself).
74 * `rss` - controls generation of an rss feed. If the wiki is configured to
75   generate rss feeds by default, set to "no" to disable. If the wiki is
76   configured to `allowrss`, set to "yes" to enable.
77 * `atom` - controls generation of an atom feed. If the wiki is configured to
78   generate atom feeds by default, set to "no" to disable. If the wiki is
79   configured to `allowatom`, set to "yes" to enable.
80 * `feeds` - controls generation of all types of feeds. Set to "no" to
81   disable generating any feeds.
82 * `emptyfeeds` - Set to "no" to disable generation of empty feeds.
83   Has no effect if `rootpage` or `postform` is set.
84 * `id` - Set to specify the value of the HTML `id` attribute for the
85  feed links or the post form. Useful if you have multiple forms in the
86  same page.
87 * `template` - Specifies the template to fill out to display each inlined
88   page. By default the `inlinepage` template is used, while
89   the `archivepage` template is used for archives. Set this parameter to
90   use some other, custom template, such as the `titlepage` template that
91   only shows post titles or the `microblog` template, optimised for
92   microblogging. Note that you should still set `archive=yes` if
93   your custom template does not include the page content.
94 * `raw` - Rather than the default behavior of creating a blog,
95   if raw is set to "yes", the page will be included raw, without additional
96   markup around it, as if it were a literal part of the source of the 
97   inlining page.
98 * `sort` - Controls how inlined pages are [[sorted|pagespec/sorting]].
99   The default is to sort the newest created pages first, and if pages
100   were created in the same commit, sort them by the name of the page
101   (equivalent to `sort="age title"`).
102 * `reverse` - If set to "yes", causes the sort order to be reversed.
103 * `feedlimit` - Specify the maximum number of matching pages to include in
104   the rss/atom feeds. The default is the same as the `limit` value above.
105   In older versions of IkiWiki this parameter was called `feedshow`, which
106   also still works.
107 * `feedonly` - Only generate the feed, do not display the pages inline on
108   the page.
109 * `quick` - Build archives in quick mode, without reading page contents for
110   metadata. This also turns off generation of any feeds.
111 * `timeformat` - Use this to specify how to display the time or date for pages
112   in the blog. The format string is passed to the strftime(3) function.
113 * `feedpages` - A [[PageSpec]] of inlined pages to include in the rss/atom
114   feeds. The default is the same as the `pages` value above, and only pages
115   matched by that value are included, but some of those can be excluded by
116   specifying a tighter [[PageSpec]] here.
117 * `guid` - If a URI is given here (perhaps a UUID prefixed with `urn:uuid:`),
118   the Atom feed will have this as its `<id>`. The default is to use the URL
119   of the page containing the `inline` directive.
120 * `feedfile` - Can be used to change the name of the file generated for the
121   feed. This is particularly useful if a page contains multiple feeds.
122   For example, set "feedfile=feed" to cause it to generate `page/feed.atom`
123   and/or `page/feed.rss`. This option is not supported if the wiki is
124   configured not to use `usedirs`.
125 * `pagenames` - If given instead of `pages`, this is interpreted as a
126   space-separated list of absolute page names ([[SubPage/LinkingRules]] are
127   not taken into account), and they are inlined in exactly the order given:
128   the `sort` and `pages` parameters cannot be used in conjunction with
129   this one.
130 * `trail` - If set to "yes" and the [[!iki plugins/trail desc=trail]] plugin
131   is enabled, turn the inlined pages into a trail with next/previous links,
132   by passing the same options to [[ikiwiki/directive/trailitems]]. The `skip`
133   and `limit` options are ignored by the trail, so the next/previous links
134   traverse through all matching pages.
136 [[!meta robots="noindex, follow"]]