Insert Images from a URL

You can reference images served from any URL (e.g., your blog, an image hosting service, your server, etc.) and never have to worry about downloading the images and putting them somewhere locally.

Image URL targets

Here are a few examples of images that have a URL target:

Example 1. Block image with a URL target
image::https://upload.wikimedia.org/wikipedia/commons/3/35/Tux.svg[Tux,250,350]
Tux
Example 2. Inline image with a URL target
You can find image:https://upload.wikimedia.org/wikipedia/commons/3/35/Tux.svg[Linux,25,35] everywhere these days.

You can find Linux everywhere these days.

The value of imagesdir is ignored when the image target is a URL.

If you want to avoid typing the URL prefix for every image, and all the images are located on the same server, you can use the imagesdir attribute to set the base URL:

Example 3. Using a URL as the base URL for images
:imagesdir-old: {imagesdir}
:imagesdir: https://upload.wikimedia.org/wikipedia/commons

image::3/35/Tux.svg[Tux,250,350]

:imagesdir: {imagesdir-old}

This time, imagesdir is used since the image target is not a URL (the value of imagesdir just happens to be one).