]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/ikiwiki/directive/img.mdwn
img: Add back support for SVG images, bypassing ImageMagick and simply passing the...
[git.ikiwiki.info.git] / doc / ikiwiki / directive / img.mdwn
1 The `img` directive is supplied by the [[!iki plugins/img desc=img]] plugin.
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.
8 ## usage
10         \[[!img image1.jpg size="200x200" alt="clouds"]]
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]].
15 The `size` parameter is optional, defaulting to full size.
16 You can specify only the width or the height, and the other value will
17 be calculated based on it: "200x", "x200".
19 If you specify both the width and height, the original image's aspect
20 ratio will be preserved, even if this means making the image smaller
21 than the specified size. (However, this is not done for svg images.)
23 You can also pass `alt`, `title`, `class`, `align`, `id`, `hspace`, and
24 `vspace` parameters.
25 These are passed through unchanged to the html img tag. If you include a
26 `caption` parameter, the caption will be displayed centered beneath the image.
28 The `link` parameter is used to control whether the scaled image links
29 to the full size version. By default it does; set "link=somepage" to link
30 to another page instead, or "link=no" to disable the link, or
31 "link=http://url" to link to a given url.
33 The `pagenumber` parameter selects which of multiple images should be rendered;
34 this is relevant mainly for GIF and PDF source images.
36 You can also set default values that will be applied to all later images on
37 the page, unless overridden. Useful when including many images on a page.
39         \[[!img defaults size=200x200 alt="wedding photo"]]
40         \[[!img photo1.jpg]]
41         \[[!img photo2.jpg]]
42         \[[!img photo3.jpg size=200x600]]
44 [[!meta robots="noindex, follow"]]