]> sipb.mit.edu Git - ikiwiki.git/blob - doc/ikiwiki/directive/meta.mdwn
Rename sort parameter to meta title/author to sortas=bar
[ikiwiki.git] / doc / ikiwiki / directive / meta.mdwn
1 The `meta` directive is supplied by the [[!iki plugins/meta desc=meta]] plugin.
2
3 This directive allows inserting arbitrary metadata into the source of a page.
4 Enter the metadata as follows:
5
6         \[[!meta field="value"]]
7         \[[!meta field="value" param="value" param="value"]]
8
9 The first form sets a given field to a given value, while the second form
10 also specifies some additional sub-parameters.
11
12 The field values are treated as HTML entity-escaped text, so you can include
13 a quote in the text by writing `"` and so on.
14
15 Supported fields:
16
17 * title
18
19   Overrides the title of the page, which is generally the same as the
20   page name.
21
22   Note that if the title is overridden, a "title_overridden" variable will
23   be set to a true value in the template; this can be used to format things
24   differently in this case.
25
26   An optional `sortas` parameter will be used preferentially when
27   [[ikiwiki/pagespec/sorting]] by `meta(title)`:
28
29         \[[!meta title="The Beatles" sortas="Beatles, The"]]
30
31         \[[!meta title="David Bowie" sortas="Bowie, David"]]
32
33 * license
34
35   Specifies a license for the page, for example, "GPL". Can contain
36   WikiLinks and arbitrary markup.
37
38 * copyright
39
40   Specifies the copyright of the page, for example, "Copyright 2007 by
41   Joey Hess". Can contain WikiLinks and arbitrary markup.
42
43 * author
44
45   Specifies the author of a page.
46
47   An optional `sortas` parameter will be used preferentially when
48   [[ikiwiki/pagespec/sorting]] by `meta(author)`:
49
50         \[[!meta author="Joey Hess" sortas="Hess, Joey"]]
51
52 * authorurl
53
54   Specifies an url for the author of a page.
55
56 * description
57
58   Specifies a short description for the page. This will be put in
59   the html header, and can also be displayed by eg, the [[map]] directive.
60
61 * permalink
62
63   Specifies a permanent link to the page, if different than the page
64   generated by ikiwiki.
65
66 * date
67
68   Specifies the creation date of the page. The date can be entered in
69   nearly any format, since it's parsed by [[!cpan TimeDate]].
70
71 * stylesheet
72
73   Adds a stylesheet to a page. The stylesheet is treated as a wiki link to
74   a `.css` file in the wiki, so it cannot be used to add links to external
75   stylesheets. Example:
76
77         \[[!meta stylesheet=somestyle rel="alternate stylesheet"
78         title="somestyle"]]
79
80 * openid
81
82   Adds html <link> tags to perform OpenID delegation to an external
83   OpenID server. This lets you use an ikiwiki page as your OpenID.
84
85   By default this will delegate for both `openid` and `openid2`. To only
86   delegate for one, add a parameter such as `delegate=openid`.
87
88   An optional `xrds-location`
89   parameter lets you specify the location of any [eXtensible Resource
90   DescriptorS](http://www.windley.com/archives/2007/05/using_xrds.shtml).
91
92   Example:
93
94         \\[[!meta openid="http://joeyh.myopenid.com/"
95         server="http://www.myopenid.com/server"
96         xrds-location="http://www.myopenid.com/xrds?username=joeyh.myopenid.com""]]
97
98 * link
99
100   Specifies a link to another page. This can be used as a way to make the
101   wiki treat one page as linking to another without displaying a user-visible
102   [[ikiwiki/WikiLink]]:
103
104        \[[!meta link=otherpage]]
105
106   It can also be used to insert a html <link> tag. For example:
107
108        \[[!meta link="http://joeyh.myopenid.com/" rel="openid.delegate"]]
109
110   However, this latter syntax won't be allowed if the 
111   [[!iki plugins/htmlscrubber desc=htmlscrubber]] plugin is enabled, since it can be used to
112   insert unsafe content.
113
114 * redir
115
116   Causes the page to redirect to another page in the wiki.
117
118         \[[!meta redir=otherpage]]
119
120   Optionally, a delay (in seconds) can be specified. The default is to
121   redirect without delay.
122
123   It can also be used to redirect to an external url. For example:
124
125         \[[!meta redir="http://example.com/"]]
126
127   However, this latter syntax won't be allowed if the 
128   [[!iki plugins/htmlscrubber desc=htmlscrubber]] plugin is enabled, since it can be used to
129   insert unsafe content.
130
131   For both cases, an anchor to jump to inside the destination page may also be
132   specified using the common `#ANCHOR` syntax.
133
134 * robots
135
136   Causes the robots meta tag to be written:
137
138         \[[!meta robots="index, nofollow"]]
139
140   Valid values for the attribute are: "index", "noindex", "follow", and
141   "nofollow". Multiple comma-separated values are allowed, but obviously only
142   some combinations make sense. If there is no robots meta tag, "index,
143   follow" is used as the default.
144
145   The value is escaped, but its contents are not otherwise checked.
146
147 * guid
148
149   Specifies a globally unique ID for a page. This guid should be a URI
150   (in particular, it can be `urn:uuid:` followed by a UUID, as per
151   [[!rfc 4122]]), and it will be used to identify the page's entry in RSS
152   and Atom feeds. If not given, the default is to use the page's URL as its
153   guid.
154
155   This is mostly useful when a page has moved, to keep the guids for
156   pages unchanged and avoid_flooding_aggregators
157   (see [[!iki tips/howto_avoid_flooding_aggregators]]).
158
159 * updated
160
161   Specifies a fake modification time for a page, to be output into RSS and
162   Atom feeds. This is useful to avoid flooding aggregators that sort by
163   modification time, like Planet: for instance, when editing an old blog post
164   to add tags, you could set `updated` to be one second later than the original
165   value. The date/time can be given in any format that
166   [[!cpan TimeDate]] can understand, just like the `date` field.
167
168 If the field is not one of the above predefined fields, the metadata will be
169 written to the generated html page as a <meta> header. However, this
170 won't be allowed if the [[!iki plugins/htmlscrubber desc=htmlscrubber]] plugin is enabled,
171 since it can be used to insert unsafe content.
172
173 [[!meta robots="noindex, follow"]]