]> sipb.mit.edu Git - ikiwiki.git/blob - doc/ikiwiki/directive/img.mdwn
Merge remote branch 'upstream/master' into prv/po
[ikiwiki.git] / doc / ikiwiki / directive / img.mdwn
1 The `img` directive is supplied by the [[!iki plugins/img desc=img]] plugin.
2
3 This is an image handling directive.  While ikiwiki supports inlining full-size
4 images by making a [[ikiwiki/WikiLink]] that points to the image, using
5 this directive you can easily scale down an image for inclusion onto a page,
6 providing a link to a full-size version.
7
8 ## usage
9
10         \[[!img image1.jpg size="200x200" alt="clouds"]]
11
12 The image file will be searched for using the same rules as used to find
13 the file pointed to by a [[ikiwiki/WikiLink]].
14
15 The `size` parameter is optional, defaulting to full size. Note that the
16 original image's aspect ratio is always preserved, even if this means
17 making the image smaller than the specified size. You can also specify only
18 the width or the height, and the other value will be calculated based on
19 it: "200x", "x200"
20
21 You can also pass `alt`, `title`, `class`, `align`, `id`, `hspace`, and
22 `vspace` parameters.
23 These are passed through unchanged to the html img tag. If you include a
24 `caption` parameter, the caption will be displayed centered beneath the image.
25
26 The `link` parameter is used to control whether the scaled image links
27 to the full size version. By default it does; set "link=somepage" to link
28 to another page instead, or "link=no" to disable the link, or
29 "link=http://url" to link to a given url.
30
31 You can also set default values that will be applied to all later images on
32 the page, unless overridden. Useful when including many images on a page.
33
34         \[[!img defaults size=200x200 alt="wedding photo"]]
35         \[[!img photo1.jpg]]
36         \[[!img photo2.jpg]]
37         \[[!img photo3.jpg size=200x600]]
38
39 [[!meta robots="noindex, follow"]]