patch plugin documentation to refer to directive pages
[ikiwiki] / doc / plugins / aggregate.mdwn
1 [[!template id=plugin name=aggregate author="[[Joey]]"]]
2 [[!tag type/useful]]
3
4 This plugin implements the [[ikiwiki/directive/aggregate]] [[ikiwiki/directive]].
5
6 New users of aggregate should enable the `aggregateinternal => 1` option in the
7 .setup file. If you don't do so, you will need to enable the [[html]] plugin
8 as well as aggregate itself, since feed entries will be stored as HTML.
9
10 The [[meta]] and [[tag]] plugins are also recommended. The
11 [[htmltidy]] plugin is suggested, since feeds can easily contain html
12 problems, some of which tidy can fix.
13
14 You will need to run ikiwiki periodically from a cron job, passing it the
15 --aggregate parameter, to make it check for new posts. Here's an example
16 crontab entry:
17
18         */15 * * * * ikiwiki --setup my.wiki --aggregate --refresh
19
20 Alternatively, you can allow `ikiwiki.cgi` to trigger the aggregation. You
21 should only need this if for some reason you cannot use cron, and instead
22 want to use a service such as [WebCron](http://webcron.org). To enable
23 this, turn on `aggregate_webtrigger` in your setup file. The url to
24 visit is `http://whatever/ikiwiki.cgi?do=aggregate_webtrigger`. Anyone
25 can visit the url to trigger an aggregation run, but it will only check
26 each feed if its `updateinterval` has passed.
27
28 ## internal pages and `aggregateinternal`
29
30 This plugin creates a page for each aggregated item. 
31
32 If the `aggregateinternal` option is enabled in the setup file (which is
33 recommended), aggregated pages are stored in the source directory with a
34 "._aggregated" extension. These pages cannot be edited by web users, and
35 do not generate first-class wiki pages. They can still be inlined into a
36 blog, but you have to use `internal` in [[PageSpecs|IkiWiki/PageSpec]],
37 like `internal(blog/*)`.
38
39 For backward compatibility, the default is that these pages have the
40 ".html" extension, and are first-class wiki pages -- each one generates
41 a separate HTML page in the output, and they can even be edited.
42
43 That turns out to not be ideal for aggregated content, because publishing
44 files for each of those pages is a waste of disk space and CPU, and you
45 probably don't want to allow them to be edited. So, there is an alternative
46 method that can be used (and is recommended), turned on by the
47 `aggregateinternal` option in the setup file.
48
49 If you are already using aggregate and want to enable `aggregateinternal`,
50 you should follow this process:
51
52 1. Update all [[PageSpecs|ikiwiki/PageSpec]] that refer to the aggregated
53    pages -- such as those in inlines. Put "internal()" around globs 
54    in those PageSpecs. For example, if the PageSpec was `foo/*`, it should
55    be changed to `internal(foo/*)`. This has to be done because internal
56    pages are not matched by regular globs.
57 2. Turn on `aggregateinternal` in the setup file.
58 3. Use [[ikiwiki-transition]] to rename all existing aggregated `.html`
59    files in the srcdir. The command to run is
60    `ikiwiki-transition aggregateinternal $setupfile`,
61 4. Refresh the wiki. (`ikiwiki -setup your.setup -refresh`)