middleman-ogp icon indicating copy to clipboard operation
middleman-ogp copied to clipboard

Using `og:image` filenames from middleman's `:asset_hash` extension

Open larsvegas opened this issue 8 years ago • 3 comments

Hey,

I'm using the middleman :asset_hash extension so assets will be renamed after build from myimage.jpg to something like myimage-f5d3f0c1.jpg.

How can I make middleman-ogp to substitute the og:image property with the correct one with the hash on build?

Thanks, Lars

larsvegas avatar Feb 05 '17 12:02 larsvegas

I'd like to see if I can contribute this to middleman-ogp. Could you maybe point me in the right direction?

tisba avatar Jun 02 '20 07:06 tisba

-ping @ngs :)

tisba avatar Jun 02 '20 07:06 tisba

This could be possible by converting value to contain asset hash.

https://github.com/ngs/middleman-ogp/blob/master/lib/middleman-ogp/extension.rb#L165

But not yet sure how to retrieve asset hash from path.

ngs avatar Jun 02 '20 14:06 ngs