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