Skip to content

How to show an image using image tag

macourtney edited this page Sep 13, 2010 · 3 revisions

Added for version: 0.4
Updated for version: 0.7

To display an image from your images resource directory you can use the image-tag function.

By default, Conjure assumes all of your images are in resources/public/images. If you want to change your images directory to another location, update the images-dir var in config/environment.clj. The images directory must be a subdirectory of public or the browser will not have access to it.

To link to the conjure96white.png image use:

(image-tag "conjure96white.png")

To set an attribute on the img tag you can pass html options.

To set the :alt attribute to “Conjure Bunny”:

(image-tag "conjure96white.png" { :alt "Conjure Bunny" })
Clone this wiki locally