Question:

Relative Asset URL

Colton: 20 May 2022

I'm looking to output the relative URL of my assets instead of the full URL with domain for my Imgix config. As imgix puts it in their docs:

http://www.yourcompany.imgix.com/images/examples/pic.jpg

Currently, my assets are rendering like so:

http://www.yourcompany.imgix.com/http://www.localmachine/images/examples/pic.jpg

Looking at this as my code:

https://domain.imgix.net/{{ image.FeaturedImage[0].url }}

Is there a way to just output a relative URL instead of absolute? (I've looked at plugins for imgix, but seems a bit overkill if it just needs a relative URL?)

Answer:
Santiago: 20 May 2022

{{ image.FeaturedImage[0].path }} may be what you are looking for, this will give you the folder and the filename of an asset.