Asset Hash in Meta

Hi everyone. I’m having trouble linking to an image after build. Currently I have

<meta property="st:image" content='<%= "http://cdn#{rand(0..3)}.example.com/#{current_page.data.image}" || "http://cdn#{rand(0..3)}.example.com/images/blog/bitcoin.jpg" %>'>

It does work except for the fact that it’s only linking to the bitcoin image prior to the asset_hash being applied to it so I get a 404 do to the original file not being there after build.

Help/advice appreciated!

  • typo edit.

Hey Dikaio,

try calling the image in url

for instance url(current_page.data.image)

Nailed it, thanks rob!