cancel
Showing results for 
Search instead for 
Did you mean: 

Opengraph requires an absolute path to image, yet each build of static site generates a random URL.

Opengraph requires an absolute path to image, yet each build of static site generates a random URL.

I understand that if I put logo.png in my custom themes Theme/Module/we/images dir I can access it with $block->getViewFileUrl('Theme_Module::images/logo.png')

 

The spec for the Opengraph image requires the meta tag to be absolute, as in: <meta name="og:image" content="https://www.example.com/images/opengraph/logo.png"/>

 

If I use the programmatic way to generate the URL, whatever random static path is current at the time will be inserted, and changed at the next build.

 

So how can you bypass this mechanism for a specific image such as this please?

 

Edit: I know I can make one for the site itself by just using an absolute path in the sites header block xml. I am looking for a way to do that per custom Theme.