ngs / middleman-ogp

middleman-og is an extension for the Middleman static site generator that adds Open Graph helper.
MIT License
37 stars 7 forks source link

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

Open larsvegas opened 7 years ago

larsvegas commented 7 years ago

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

tisba commented 4 years ago

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

tisba commented 4 years ago

-ping @ngs :)

ngs commented 4 years ago

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.