#image full URL

2 messages · Page 1 of 1 (latest)

sick topazBOT
#

Hi @twilit wagon. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

In the context of using images from a CMS or CDN in Astro, "an image’s full URL" means the complete web address (including the protocol, such as <https://>) that points directly to the image file hosted on the remote server, CMS, or CDN. For example, <https://example.com/images/photo.jpg> is a full URL.

When using the <Image /> component, an <img> tag, or Markdown image syntax, you should provide this full URL as the src attribute if the image is not stored locally in your project but is instead hosted externally. This allows Astro to fetch and display the image from the remote source. For remote image optimization, you may also need to authorize the domain or URL pattern in your Astro config Using Images from a CMS or CDN.

Example usage:

<Image src="<https://cdn.example.com/images/photo.jpg"> alt="Descriptive alt text" width="400" height="300" />

or

![Alt text](<https://cdn.example.com/images/photo.jpg>)

This is in contrast to using a relative path for local images or images in your public/ folder. The "full URL" is required for any image that is not part of your local project files.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: