Which output format are you using ? You yaml does not show.
Here are some general thoughts as I do not have the specific info about the format you are using.
I believe it works for blogdown if the hugo theme used supports it. For HTML document, it would need to be customized per document depending on the template and theme used.
Best solution is to use metathis
that works well for several format for this cross format feature that is social media cart. Does it work for you ? It seems a simple solution to add a chunk at the beginning of the document with this informations don't you think ? IMO as simple as providing in the yaml header, and easier to maintain technically to be usable easily across several format.
Note that if you are using this with the same output (don't know which) and you do that often, you could create your own template to pass to the format function and knowing where to insert the variable you are passing in the YAML header.
Hope it helps