Support Forums

Static link to asset for structured data (JSON LD)

Hi everyone,

I’ve just finished my first Netlify project ever so please bear with me.

I’ve activated the optimization of all assets. However, some of the structured data fields (JSON LD format) that I would like to add to my site require image urls. Is it possible to exclude some images from optimization, resulting in static links?

Alternatively, if that isn’t in option, would it be possible to create a subdomain like media.domain.com on Netlify that points to a different host where I could store the files I need?

Thanks a lot in advance. :blush:

Hi @manuelschroeder,

The original image linked in structured data should also exist. Netlify won’t process absolute URLs or images in structured data for that matter, but yes, they should exist in the final deploy.

The problem is, you’ve added the following URL: https://www.manuelschroeder.dev/test.jpg and that URL doesn’t exist in your deploy.

As for the last point, there’s no option to get a custom subdomain for the media.

Thanks, that’s good to know.

The test.jpg URL was just added to be able to test the other structured data entries until I figured out a solution.

All I had to do was add the image to my static folder in my gridsome project, that made it available in the root folder after building and deploying.

Thanks a lot!