Condition to know if local image or URL


I’ve been looking for two days, but I must be using the wrong English terms, because I’m going in circles.

I’m on a single render hook for my images, but as soon as I place an image from a URL, it doesn’t want to build the site.

I can’t find the condition to write to know if it’s a local image or a URL.

I found a line saying if it contains http then it’s an external, but I can’t get my hands on that URL.

Do you have a better way to write this?

Thanks in advance

The URL.

Conditional check if URL .Destination has http prefix:

{{ if hasPrefix .Destination "http" }}
  {{/* This render link/image destination with "http" prefix */}}
{{ else }}
  {{/* This render link/image destination without "http" prefix */}}
{{ end }}

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.