1

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?)

2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.