Google might be doing something special, because they're Google, but it's definitely possible to make it dynamic server-side. If a sevrer renders a page using a template and knows something about the route it's rendering, it can swap out the image for another one or even generate it on the fly, for example as a base64 image as in this question.
An example of this using Jinja templates (for Python) would be <meta property="og:image" content="{{ map_location.thumbnail }}"/>
. A more complex example using JavaScript template strings might be:
render(
`
<html>
<!-- other content -->
<meta property="og:image" content="/images/${request.parameters.id}.png"/>
<!-- other content -->
</html>
`
)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…